Difference between
modified post 88b0 by Anonymous on Mon 14th Jan 2013 20:49
original post 87fddc by Anonymous on Mon 14th Jan 2013 19:46
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | START: | |
| 2 | 2 | MOV AH,00h ;get into video mode. 00 = Set Video Mode | |
| 3 | 3 | MOV AL,13h ;13h = 320x240x16 | |
| 4 | 4 | INT 10h | |
| 5 | 5 | SET_VSEGMENT: ;set up video segment | |
| 6 | 6 | MOV AX,0A000h ;point ES to VGA segment | |
| 7 | 7 | MOV ES,AX | |
| 8 | 8 | VALUES: ;various values used for plotting later on | |
| 9 | 9 | MOV CX,15 ;length of line. used for REP | |
| 10 | 10 | %macro get_offset 2 ;%1 = X and %2 = y . calculates the offset location | |
| 11 | 11 | MOV AX,%1 ;copy X location passed to macro to AX | |
| 12 | 12 | MOV BX,%2 ;copy Y location passed to macro to BX | |
| 13 | 13 | MOV DI,AX ;put X location into DI | |
| 14 | 14 | MOV DX,BX ;and Y into DX | |
| 15 | 15 | SHL BX,8 ;Y * 2^8. same as saying Y * 256 | |
| 16 | 16 | SHL DX,6 ;Y * 2^8. same as saying Y * 64 | |
| 17 | 17 | ADD DX,BX ;add the two together | |
| 18 | 18 | ADD DI,BX ;and add the X location | |
| 19 | 19 | %endmacro ;end macro | |
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | 25 | ; starting Y location. | |
| 26 | 26 | MOV BX,0x64 | |
| 27 | 27 | MOV AL,0 | |
| 28 | - | LL1: | |
| 29 | - | ||
| 30 | 28 | LL2: | |
| 31 | 29 | push AX | |
| 32 | 30 | push BX | |
| 33 | 31 | get_offset AX,BX | |
| 34 | 32 | STOSB | |
| 35 | 33 | POP BX | |
| 36 | 34 | POP AX | |
| 37 | 35 | ADD AX,0x02 | |
| 38 | 36 | ADD AL,0x01 | |
| 39 | - | CMP AL,0xc8 | |
| 37 | + | CMP AL,0x0F | |
| 40 | 38 | JNE LL2 | |
| 41 | 39 | ||
| 42 | 40 | ADD BX,0x01 | |
| 43 | - | CMP BX,0xF | |
| 41 | + | CMP BX,0xc8 | |
| 44 | - | JNE LL1 | |
| 42 | + | JNE LL2 | |
| 45 | 43 | ||
| 46 | 44 | WAIT_FOR_KEY_PRESS: | |
| 47 | 45 | MOV AH,0x00 | |
| 48 | 46 | INT 0x16 | |
| 49 | 47 | REBOOT: | |
| 50 | 48 | DB 0xEA | |
| 51 | 49 | DW 0x0000 | |
| 52 | 50 | DW 0xFFFF | |
| 53 | 51 | times 0200h - 2 - ($ - $$) db 0 | |
| 54 | 52 | SIGNATURE DW 0xAA55 |
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
kpaste.net RSS