Rev 49 | Blame | Compare with Previous | Last modification | View Log | Download
;PROC setxy FORWARD(BYTE x, BYTE y);setxysetxy.A.=$+1;setxy.x=$+1setxy.B.=$+2;setxy.y=$+2ld de,0;OS_SETXYld c,CMD_SETXY;0xf8call BDOS;0x0005ret;PROC prchar FORWARD(CHAR c);prcharprchar.A.=$+1;prchar.c=$+1ld a,0prcharA.rst 0x10ret;PROC nprintf FORWARD(; PCHAR s,; UINT d0,; UINT d1,; UINT d2,; UINT d3,; UINT d4,; UINT d5,; UINT d6,; UINT d7,; UINT d8,; UINT d9;);nprintfnprintf.A.=$+1;nprintf.s=$+1ld de,0ld hl,nprintf.B. ;poi to 1st datanprintf0.ld a,[de]or aret zinc decp '%'jr z,nprintf0.format.nprintf0.formatqpush depush hlcall prcharA.pop hlpop dejr nprintf0.nprintf0.format.ld a,[de]inc decp 'c'jr z,nprintf0.format.c.cp 'd'jr z,nprintf0.format.d.cp 's'jr z,nprintf0.format.s.cp 'x'jr z,nprintf0.format.x.cp '%'jr z,nprintf0.formatqretnprintf0.format.c.ld a,[hl]inc hlinc hlpush hlcall prcharA.pop hljr nprintf0.nprintf0.format.d.push deld e,[hl]inc hlld d,[hl]inc hlpush hlex de,hlld bc,10000call nprintf.dig.ld bc,1000call nprintf.dig.ld bc,100call nprintf.dig.ld bc,10call nprintf.dig.ld bc,1call nprintf.dig.pop hlpop dejr nprintf0.nprintf0.format.s.push deld e,[hl]inc hlld d,[hl]inc hlpush hlnprintfs0.ld a,[de]or ajr z,nprintfsq.inc depush depush hlcall prcharA.pop hlpop dejr nprintfs0.nprintfsq.pop hlpop dejr nprintf0.nprintf0.format.x.push deld e,[hl]inc hlld d,[hl]inc hlpush hlld a,dcall nprintf.hdig.call nprintf.hdig.ld a,ecall nprintf.hdig.call nprintf.hdig.pop hlpop dejp nprintf0.nprintf.hdig.rrcarrcarrcarrcapush afor 0xf0daaadd a,0xa0adc a,0x40push decall prcharA.pop depop afretnprintf.dig.ld a,'0'-1or anprintf.dig0.inc asbc hl,bcjr nc,nprintf.dig0.add hl,bcpush hlcall prcharA.pop hlretnprintf.B.dw 0nprintf.C.dw 0nprintf.D.dw 0nprintf.E.dw 0nprintf.F.dw 0nprintf.G.dw 0nprintf.H.dw 0nprintf.I.dw 0nprintf.J.dw 0nprintf.K.dw 0