Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include gemdos.i
- include xbios.i
- include stmacros.i
- start:
- ClearScreen:
- PrintString ClearHome
- GetPhysBase:
- PUSH #physbase
- TRAP #14
- CORRECT #2
- move.l d0,a4
- move.l d0,GFX_BASE
- DrawAPixel:
- move.l #400,d0
- move.l #10,d1
- jsr PlotHiResPixel
- Hello:
- PrintString HelloWorld
- Wait:
- GEMDOS 1 ;wait for keypress
- CORRECT #2
- End:
- GEMDOS 0 ;pterm0
- ;Functions
- ;Calculates d0 mod 8, returns it in d1
- Modulus8:
- divu #8,d0
- swap d0
- move.w d0,d1
- rts
- ;Returns 0x01 ROL by d0 in d3
- PlotHiResPixel:
- ;d0 = horizontal coordinate
- ;d1 = vertical coordinate
- ;horizontal plotting
- move.l #400,d0 ;pixel number to plot
- divu #8,d0
- move.l d0,d2
- swap d2
- jsr BitIndex ;d3 = the bit pattern to plot
- add.l d0,a4
- ;vertical plotting
- mulu #80,d1 ;640px wide / 8 = 80
- add.l d1,a4
- ;plot the pixel and return
- move.b d3,(a4)
- rts
- BitIndex:
- move.w d0,d4
- move.b #%00000001,d3
- rol d2,d3
- RTS
- SECTION DATA
- GFX_BASE dc.l 0
- ;Escape codes
- ClearHome dc.b $1B,"E",0
- HelloWorld dc.b "Hello World!",$0D,$0A,0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement