implemented "division by zero" check in asm; still, it is 7 bytes smaller! ;-)
[bz80asm.git] / output_driver_std.zas
blob5bca783ae8f642d9f6ace885140f3133847cdd59
1 emitInit:
2   ld    a,2
3   call  #1601 ; open main screen channel
4   ld    hl,#4000
5   ld    de,#4001
6   ld    bc,#17FF
7   ld    (hl),l
8   ldir
9   ld    (emitSavedIY),iy
10   ld    a,31
11   ld    (WIDTH),a
12   ret
15 emitSavedIY: defw 0
17 ; A: code
18 ; should preserve registers (except A and F)
19 OSWRCH:
20   push  iy
21   ld    iy,(emitSavedIY)
22   ei
23   rst   #10
24   di
25   ld    (emitSavedIY),iy
26   pop   iy
27   ret