- START:
- MOV AH,00h ;get into video mode. 00 = Set Video Mode
- MOV AL,13h ;13h = 320x240x16
- INT 10h
- SET_VSEGMENT: ;set up video segment
- MOV AX,0A000h ;point ES to VGA segment
- MOV ES,AX
- VALUES: ;various values used for plotting later on
- MOV CX,15 ;length of line. used for REP
- %macro get_offset 2 ;%1 = X and %2 = y . calculates the offset location
- PUSH AX
- PUSH BX
- MOV AX,%1 ;copy X location passed to macro to AX
- MOV BX,%2 ;copy Y location passed to macro to BX
- MOV DI,AX ;put X location into DI
- MOV DX,BX ;and Y into DX
- SHL BX,8 ;Y * 2^8. same as saying Y * 256
- SHL DX,6 ;Y * 2^8. same as saying Y * 64
- ADD DX,BX ;add the two together
- ADD DI,BX ;and add the X location
- POP BX
- POP AX
- %endmacro ;end macro
- ; starting Y location.
- MOV BX,100
- LOOP_LABEL:
- get_offset AX,BX
- MOV AL,0
- STOSB
- MOV AX,102 ;X location
- get_offset AX,BX
- MOV AL,1
- STOSB
- MOV AX,104 ;X location
- get_offset AX,BX
- MOV AL,2
- STOSB
- MOV AX,106 ;X location
- get_offset AX,BX
- MOV AL,3
- STOSB
- MOV AX,108 ;X location
- get_offset AX,BX
- MOV AL,4
- STOSB
- MOV AX,110 ;X location
- get_offset AX,BX
- MOV AL,5
- STOSB
- MOV AX,112 ;X location
- get_offset AX,BX
- MOV AL,6
- STOSB
- MOV AX,114 ;X location
- get_offset AX,BX
- MOV AL,7
- STOSB
- MOV AX,116 ;X location
- get_offset AX,BX
- MOV AL,8
- STOSB
- MOV AX,118 ;X location
- get_offset AX,BX
- MOV AL,9
- STOSB
- MOV AX,120 ;X location
- get_offset AX,BX
- MOV AL,10
- STOSB
- MOV AX,122 ;X location
- get_offset AX,BX
- MOV AL,11
- STOSB
- MOV AX,124 ;X location
- get_offset AX,BX
- MOV AL,12
- STOSB
- MOV AX,126 ;X location
- get_offset AX,BX
- MOV AL,13
- STOSB
- MOV AX,128 ;X location
- get_offset AX,BX
- MOV AL,14
- STOSB
- MOV AX,130 ;X location
- get_offset AX,BX
- MOV AL,15
- STOSB
- MOV AX,132 ;X location
- get_offset AX,BX
- MOV AL,16
- STOSB
- ADD BX,01h
- CMP BX,200
- JNE LOOP_LABEL
- WAIT_FOR_KEY_PRESS:
- MOV AH,0x00
- INT 0x16
- REBOOT:
- DB 0xEA
- DW 0x0000
- DW 0xFFFF
- SIGNATURE DW 0xAA55
Untitled
Posted by Anonymous on Mon 14th Jan 2013 18:54
raw | new post
view followups (newest first): Untitled by Anonymous
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