;;; gcc for m6809 : Mar 27 2025 02:43:37 ;;; 4.6.4 (gcc6809lw pl9) ;;; ABI version 1 ;;; -mint16 .module clock.c .area .text _PPutHex: pshs u leas -2,s ldu 6,s cmpu #15 ;cmphi: bls L2 tfr u,d lsra rorb lsra rorb lsra rorb lsra rorb pshs d jsr _PPutHex leas 2,s L2: tfr u,d anda #0 andb #15 tfr d,u ldb _PHexAlphabet,u stb ,x+ leas 2,s puls u,pc _PDivMod10: ldd #0 bra L4 L5: leax -10000,x addd #1000 L4: cmpx #9999 ;cmphi: bhi L5 bra L12 L7: leax -1000,x addd #100 L12: cmpx #999 ;cmphi: bhi L7 bra L13 L9: leax -100,x addd #10 L13: cmpx #99 ;cmphi: bhi L9 bra L14 L11: leax -10,x addd #1 L14: cmpx #9 ;cmphi: bhi L11 std [2,s] tfr x,d ;movlsbqihi: R:x -> R:b rts _PPutDec: pshs y,u leas -4,s leau ,s stx ,u ldy 10,s cmpy #9 ;cmphi: bls L16 ldd #2 pshs u ;addhi: R:d += R:u addd ,s++ pshs d leax ,y jsr _PDivMod10 ldx 2,u stx ,--s ldx ,u jsr _PPutDec stx ,u leas 4,s L16: ldd #2 pshs u ;addhi: R:d += R:u addd ,s++ pshs d leax ,y jsr _PDivMod10 ldx ,u addb #48 stb ,x+ leas 6,s puls y,u,pc _FONT_Wrapper: ;----- asm ----- ; 23 "../games/clock/game.c" 1 ;;; _FONT: fcb $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 fcb $38,$38,$38,$10,$10,$00,$38,$00,$00,$00,$00,$00 fcb $6c,$6c,$48,$00,$00,$00,$00,$00,$00,$00,$00,$00 fcb $00,$14,$7e,$28,$28,$fc,$50,$00,$00,$00,$00,$00 fcb $3e,$6a,$78,$3c,$1e,$56,$7c,$10,$00,$00,$00,$00 fcb $72,$da,$74,$18,$2e,$5b,$4e,$00,$00,$00,$00,$00 fcb $30,$68,$68,$77,$da,$dc,$76,$00,$00,$00,$00,$00 fcb $18,$18,$10,$00,$00,$00,$00,$00,$00,$00,$00,$00 fcb $08,$10,$30,$30,$30,$30,$10,$08,$00,$00,$00,$00 fcb $20,$10,$18,$18,$18,$18,$10,$20,$00,$00,$00,$00 fcb $00,$10,$54,$38,$54,$10,$00,$00,$00,$00,$00,$00 fcb $00,$18,$18,$7e,$18,$18,$00,$00,$00,$00,$00,$00 fcb $00,$00,$00,$00,$00,$18,$18,$10,$00,$00,$00,$00 fcb $00,$00,$00,$7c,$00,$00,$00,$00,$00,$00,$00,$00 fcb $00,$00,$00,$00,$00,$18,$18,$00,$00,$00,$00,$00 fcb $06,$0c,$0c,$18,$18,$30,$30,$60,$00,$00,$00,$00 fcb $18,$24,$66,$66,$66,$24,$18,$00,$00,$00,$00,$00 fcb $18,$38,$18,$18,$18,$18,$3c,$00,$00,$00,$00,$00 fcb $3c,$66,$06,$0c,$18,$32,$7e,$00,$00,$00,$00,$00 fcb $3c,$66,$06,$1c,$06,$66,$3c,$00,$00,$00,$00,$00 fcb $0c,$1c,$2c,$4c,$7e,$0c,$0c,$00,$00,$00,$00,$00 fcb $3e,$60,$70,$0c,$06,$46,$3c,$00,$00,$00,$00,$00 fcb $1c,$30,$60,$7c,$66,$66,$3c,$00,$00,$00,$00,$00 fcb $7e,$46,$06,$0c,$0c,$18,$18,$00,$00,$00,$00,$00 fcb $3c,$62,$72,$3c,$4e,$46,$3c,$00,$00,$00,$00,$00 fcb $3c,$66,$66,$3e,$06,$0c,$38,$00,$00,$00,$00,$00 fcb $00,$00,$18,$18,$00,$18,$18,$00,$00,$00,$00,$00 fcb $00,$00,$18,$18,$00,$18,$18,$10,$00,$00,$00,$00 fcb $00,$06,$1c,$70,$1c,$06,$00,$00,$00,$00,$00,$00 fcb $00,$00,$7c,$00,$7c,$00,$00,$00,$00,$00,$00,$00 fcb $00,$60,$38,$0e,$38,$60,$00,$00,$00,$00,$00,$00 fcb $3c,$66,$06,$0c,$10,$00,$30,$00,$00,$00,$00,$00 fcb $38,$44,$de,$e6,$e6,$de,$40,$3c,$00,$00,$00,$00 fcb $18,$18,$2c,$2c,$7e,$46,$ef,$00,$00,$00,$00,$00 fcb $fc,$66,$66,$7c,$66,$66,$fc,$00,$00,$00,$00,$00 fcb $3a,$66,$c0,$c0,$c0,$62,$3c,$00,$00,$00,$00,$00 fcb $f8,$6c,$66,$66,$66,$6c,$f8,$00,$00,$00,$00,$00 fcb $fe,$62,$68,$78,$68,$62,$fc,$00,$00,$00,$00,$00 fcb $fe,$62,$68,$78,$68,$60,$f0,$00,$00,$00,$00,$00 fcb $34,$6c,$c0,$ce,$c4,$64,$38,$00,$00,$00,$00,$00 fcb $f7,$66,$66,$7e,$66,$66,$ef,$00,$00,$00,$00,$00 fcb $3c,$18,$18,$18,$18,$18,$3c,$00,$00,$00,$00,$00 fcb $1e,$0c,$0c,$0c,$6c,$68,$30,$00,$00,$00,$00,$00 fcb $ee,$64,$68,$70,$78,$6c,$ee,$00,$00,$00,$00,$00 fcb $f0,$60,$60,$60,$60,$62,$fc,$00,$00,$00,$00,$00 fcb $f7,$76,$76,$5a,$5a,$5a,$e7,$00,$00,$00,$00,$00 fcb $ce,$64,$74,$7c,$5c,$4c,$e4,$00,$00,$00,$00,$00 fcb $38,$6c,$c6,$c6,$c6,$6c,$38,$00,$00,$00,$00,$00 fcb $fc,$66,$66,$64,$78,$60,$f0,$00,$00,$00,$00,$00 fcb $38,$6c,$c6,$c6,$c6,$6c,$38,$0c,$00,$00,$00,$00 fcb $fc,$66,$66,$7c,$6c,$66,$f7,$00,$00,$00,$00,$00 fcb $3a,$66,$70,$3c,$0e,$66,$5c,$00,$00,$00,$00,$00 fcb $7e,$5a,$18,$18,$18,$18,$3c,$00,$00,$00,$00,$00 fcb $e7,$62,$62,$62,$62,$62,$3c,$00,$00,$00,$00,$00 fcb $e7,$62,$62,$34,$34,$18,$18,$00,$00,$00,$00,$00 fcb $f7,$6a,$6a,$7e,$7e,$76,$62,$00,$00,$00,$00,$00 fcb $e6,$64,$38,$38,$38,$4c,$ce,$00,$00,$00,$00,$00 fcb $f7,$62,$34,$34,$18,$18,$3c,$00,$00,$00,$00,$00 fcb $7e,$46,$0c,$18,$30,$62,$7e,$00,$00,$00,$00,$00 fcb $3c,$30,$30,$30,$30,$30,$30,$3c,$00,$00,$00,$00 fcb $60,$30,$30,$18,$18,$0c,$0c,$06,$00,$00,$00,$00 fcb $3c,$0c,$0c,$0c,$0c,$0c,$0c,$3c,$00,$00,$00,$00 fcb $10,$38,$6c,$44,$00,$00,$00,$00,$00,$00,$00,$00 fcb $00,$00,$00,$00,$00,$00,$00,$ff,$00,$00,$00,$00 ;--- end asm --- rts _DivMod10: ldd #0 bra L19 L20: leax -10000,x addd #1000 L19: cmpx #9999 ;cmphi: bhi L20 bra L27 L22: leax -1000,x addd #100 L27: cmpx #999 ;cmphi: bhi L22 bra L28 L24: leax -100,x addd #10 L28: cmpx #99 ;cmphi: bhi L24 bra L29 L26: leax -10,x addd #1 L29: cmpx #9 ;cmphi: bhi L26 std [2,s] tfr x,d ;movlsbqihi: R:x -> R:b rts LC0: .ascii "hello clock\0" .area .text.startup .globl _main _main: ;----- asm ----- ; 5 "../kernel/game_postlude.h" 1 .globl __n1pre_entry ;--- end asm --- ldx #__n1pre_entry stx 0 ;----- asm ----- ; 8 "../kernel/game_postlude.h" 1 .globl __n1pre_final ;--- end asm --- ldx #__n1pre_final stx 0 ;----- asm ----- ; 11 "../kernel/game_postlude.h" 1 .globl __n1pre_final_startup ;--- end asm --- ldx #__n1pre_final_startup stx 0 ldx #_FONT_Wrapper stx 0 ldx #13312 L31: ldd #0 std ,x++ cmpx #16384 ;cmphi: bne L31 ldx #13312 jsr _gPMode1Screen ldx #LC0 jsr _gNetworkLog ldx #__n1pre_final_startup stx ,--s ldx #__n1pre_final stx ,--s ldx #_loop jsr _xAfterSetup leas 4,s ldx #0 rts .area .text _Sprintf: pshs y,u leas -11,s ldx 17,s ldy 19,s leau 21,s stu 4,s ldu #31 stu 8,s sty 6,s ldy 4,s jmp L34 L50: ldd 8,s addd #-1 std 8,s bne L35 ldb #92 stb ,x+ jmp L36 L35: ldb 4,s cmpb #31 ;cmpqi: bhi L37 ldb #10 bra L52 L37: ldb 4,s cmpb #37 ;cmpqi: beq L39 L52: stb ,x+ ldu 6,s stu 4,s jmp L38 L39: ldu 6,s leau 1,u stu 4,s ldu 6,s ldb 1,u cmpb #115 ;cmpqi: beq L42 bhi L45 cmpb #100 ;cmpqi: lbne L40 bra L54 L45: cmpb #117 ;cmpqi: beq L43 cmpb #120 ;cmpqi: lbne L40 bra L55 L54: leau 2,y stu 6,s ldu ,y bpl L46 exg d,u nega negb sbca #0 exg d,u ldb #45 stb ,x+ L46: pshs u jsr _PPutDec leas 2,s jmp L51 L43: leau 2,y ldy ,y sty ,--s jsr _PPutDec bra L53 L55: leau 2,y ldy ,y sty ,--s jsr _PPutHex L53: leas 2,s leay ,u bra L38 L42: leau 2,y stu 6,s ldy ,y sty 2,s ldu #30 stx ,s bra L47 L49: ldb 10,s ldy ,s stb ,y leay 1,x sty ,s cmpu #0 ;cmphi: bne L48 ldb #92 stb 1,x leax 2,x bra L51 L48: leau -1,u L47: ldx ,s ldy 2,s leay 1,y sty 2,s leay -1,y ldb ,y+ stb 10,s bne L49 L51: ldy 6,s bra L38 L40: stb ,x+ L38: ldu 4,s leau 1,u stu 6,s L34: ldu 6,s ldb ,u stb 4,s lbne L50 L36: clr ,x leas 11,s puls y,u,pc _DrawChar.constprop.1: pshs y,u leas -13,s clra ;zero_extendqihi: R:b -> R:d addd #-32 std ,s aslb rola aslb rola aslb rola tfr d,x ldd ,s aslb rola aslb rola pshs x ;addhi: R:d += R:x addd ,s++ addd #_FONT std 7,s ldx #0 stx 2,s L59: ldd 2,s addd 7,s tfr d,x ldb ,x stb 9,s ldb 3,s ;movlsbqihi: msb:2,s -> R:b addb 20,s clra ;zero_extendqihi: R:b -> R:d aslb rola aslb rola aslb rola aslb rola aslb rola addd #13312 std 10,s ldx #0 stx 4,s ldb #-128 stb 6,s L58: ldb 6,s andb 9,s beq L57 ldd 4,s stb ,s ;movlsbqihi: R:d -> ,s ldb 19,s addb ,s stb ,s lsrb lsrb clra ;zero_extendqihi: R:b -> R:d ldx 10,s leay d,x ldb ,y stb 12,s ldb ,s andb #3 stb ,s clra ;zero_extendqihi: R:b -> R:d tfr d,u ldx #3 tfr x,d pshs u ;subhi: R:d -= R:u subd ,s++ aslb rola tfr d,x ldd #2 jsr _ashlhi3 stb 1,s ldb 12,s eorb 1,s stb ,y L57: lsr 6,s ldd 4,s addd #1 std 4,s cmpd #8 ;cmphi: lbne L58 ldd 2,s addd #1 std 2,s cmpd #8 ;cmphi: lbne L59 leas 13,s puls y,u,pc _PrintAt.constprop.0: pshs y,u leas -2,s stb 1,s leay ,x ldu 8,s ldb #3 stb ,s L75: cmpy #0 ;cmphi: beq L76 ldb ,y bne L76 ldy #0 L76: cmpu #0 ;cmphi: beq L65 ldb ,u bne L65 ldu #0 L65: cmpy #0 ;cmphi: beq L66 cmpu #0 ;cmphi: beq L67 ldb ,y cmpb ,u ;cmpqi: beq L68 L67: ldb 1,s pshs b ldb 1,s pshs b ldb ,y jsr _DrawChar.constprop.1 leas 2,s L66: cmpu #0 ;cmphi: beq L69 ldb 1,s pshs b ldb 1,s pshs b ldb ,u jsr _DrawChar.constprop.1 leas 2,s L69: cmpy #0 ;cmphi: beq L70 L68: leay 1,y L70: cmpu #0 ;cmphi: beq L71 leau 1,u L71: ldb ,s addb #8 stb ,s cmpy #0 ;cmphi: lbne L75 cmpu #0 ;cmphi: lbne L76 leas 2,s puls y,u,pc LC1: .ascii "%s %d %s %d\0" _loop: leas -3,s ldd #16 std ,--s ldd #0 std ,--s ldx #_time_buf jsr _memset leax 5,s pshs x ldb _gWall+2 clra ;zero_extendqihi: R:b -> R:d tfr d,x jsr _DivMod10 stb 6,s ldb 8,s addb #48 stb _time_buf ldb 6,s addb #48 stb _time_buf+1 ldb #58 stb _time_buf+2 leax 7,s pshs x ldb _gWall+1 clra ;zero_extendqihi: R:b -> R:d tfr d,x jsr _DivMod10 stb 8,s ldb 10,s addb #48 stb _time_buf+3 ldb 8,s addb #48 stb _time_buf+4 ldb #58 stb _time_buf+5 leas 8,s leax 1,s pshs x ldb _gWall clra ;zero_extendqihi: R:b -> R:d tfr d,x jsr _DivMod10 stb 2,s ldb 4,s addb #48 stb _time_buf+6 ldb 2,s addb #48 stb _time_buf+7 clr _time_buf+8 ldx #_old_time_buf stx ,--s ldx #_time_buf ldb #30 jsr _PrintAt.constprop.0 ldd #16 std ,--s ldx #_time_buf stx ,--s ldx #_old_time_buf jsr _memcpy leas 8,s ldd #30 std ,--s ldd #0 std ,--s ldx #_date_buf jsr _memset ldb _gWall+5 clra ;zero_extendqihi: R:b -> R:d tfr d,x leax 2000,x pshs x ldx #_gWall+10 stx ,--s ldb _gWall+3 clra ;zero_extendqihi: R:b -> R:d pshs d ldx #_gWall+6 stx ,--s ldx #LC1 stx ,--s ldx #_date_buf stx ,--s jsr _Sprintf leas 16,s ldx #_old_date_buf stx ,--s ldx #_date_buf ldb #50 jsr _PrintAt.constprop.0 ldd #30 std ,--s ldx #_date_buf stx ,--s ldx #_old_date_buf jsr _memcpy ldd _gMono+2 leas 6,s bra L83 L84: ldx _junk_counter stx 16382 leax 1,x stx _junk_counter L83: cmpd _gMono+2 ;cmphi: beq L84 leas 3,s rts .area .text.entry __n1pre_entry: .byte 126 .word _main .area .final __n1pre_final: .word -20754 .area .final.setup __n1pre_final_startup: .word -20753 .area .bss _time_buf: .blkb 16 _old_time_buf: .blkb 16 _date_buf: .blkb 30 _old_date_buf: .blkb 30 _junk_counter: .blkb 2 .area .text _PHexAlphabet: .ascii "0123456789ABCDEF\0" .area .absolute .globl _gAlloc64 _gAlloc64 EQU $0B7F .globl _gConfig _gConfig EQU $0607 .globl _gFatal _gFatal EQU $0AC4 .globl _gFatalFIRQ _gFatalFIRQ EQU $0B15 .globl _gFatalSWI1 _gFatalSWI1 EQU $0B59 .globl _gFatalSWI2 _gFatalSWI2 EQU $0B43 .globl _gFatalSWI3 _gFatalSWI3 EQU $0B2C .globl _gFree64 _gFree64 EQU $06EB .globl _gIrqRestore _gIrqRestore EQU $06E0 .globl _gIrqSaveAndDisable _gIrqSaveAndDisable EQU $06D3 .globl _gKern _gKern EQU $0657 .globl _gModeScreen _gModeScreen EQU $0A8D .globl _gMono _gMono EQU $0020 .globl _gNetworkLog _gNetworkLog EQU $0D78 .globl _gPMode1Screen _gPMode1Screen EQU $0A60 .globl _gReceiveCast64 _gReceiveCast64 EQU $0758 .globl _gScore _gScore EQU $060B .globl _gSendCast _gSendCast EQU $0DAE .globl _gTextScreen _gTextScreen EQU $09CA .globl _gWall _gWall EQU $0637 .globl _memcpy _memcpy EQU $08D1 .globl _memcpy_words _memcpy_words EQU $0775 .globl _memset _memset EQU $08AB .globl _memset_words _memset_words EQU $0863 .globl _strlen _strlen EQU $08F3 .globl _xAfterSetup _xAfterSetup EQU $070B .globl _xSendControlPacket _xSendControlPacket EQU $0D91