1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-08-02 09:29:35 +00:00

Added ASM function signature comment. Closes #82.

This commit is contained in:
jespergravgaard 2019-02-19 20:51:48 +01:00
parent af54695232
commit dfd9af4d84
121 changed files with 1115 additions and 24 deletions

View File

@ -71,6 +71,8 @@ public class Pass4CodeGeneration {
if(block.isProcedureEntry(program)) {
Procedure procedure = block.getProcedure(program);
generateComments(asm, procedure.getComments());
// Generate parameter information
generateSignatureComments(asm, procedure);
}
// Start the new scope
asm.addScopeBegin(block.getLabel().getFullName().replace('@', 'b').replace(':', '_'));
@ -142,6 +144,42 @@ public class Pass4CodeGeneration {
program.setAsm(asm);
}
/**
* Generate a comment that describes the procedure signature and parameter transfer
* @param asm The assembler program being generated
* @param procedure The procedure
*/
private void generateSignatureComments(AsmProgram asm, Procedure procedure) {
StringBuilder signature = new StringBuilder();
signature.append(" ").append(procedure.getLocalName()).append("(");
int i = 0;
for(Variable parameter : procedure.getParameters()) {
List<VariableVersion> versions = new ArrayList<>(procedure.getVersions((VariableUnversioned) parameter));
if(versions.size() > 0) {
VariableVersion param = versions.get(0);
Registers.Register allocation = param.getAllocation();
if(i++ > 0) signature.append(", ");
signature.append(param.getType().getTypeName()).append(" ");
if(allocation instanceof Registers.RegisterZp) {
Registers.RegisterZp registerZp = (Registers.RegisterZp) allocation;
signature.append("zeropage(").append(AsmFormat.getAsmNumber(registerZp.getZp())).append(")");
} else if(allocation instanceof Registers.RegisterAByte) {
signature.append("register(A)");
} else if(allocation instanceof Registers.RegisterXByte) {
signature.append("register(X)");
} else if(allocation instanceof Registers.RegisterYByte) {
signature.append("register(Y)");
}
signature.append(" ");
signature.append(parameter.getLocalName());
}
}
signature.append(")");
if(i>0) {
asm.addComment(signature.toString(), false);
}
}
/**
* Add constant declarations for all scope constants
*

View File

@ -99,10 +99,10 @@ public class TestPrograms {
compileAndCompare("runtime-unused-procedure");
}
//@Test
//public void testRobozzle64() throws IOException, URISyntaxException {
// compileAndCompare("complex/robozzle64/robozzle64");
//}
// @Test
// public void testRobozzle64() throws IOException, URISyntaxException {
// compileAndCompare("complex/robozzle64/robozzle64");
// }
@Test
public void testTetrisSprites() throws IOException, URISyntaxException {

View File

@ -54,6 +54,7 @@ main: {
jsr test
rts
}
// test(byte register(X) i, byte zeropage(2) a)
test: {
.label a = 2
lda a

View File

@ -949,6 +949,7 @@ main: {
rts
}
//SEG77 test
// test(byte zeropage(3) i, byte zeropage(2) a)
test: {
.label a = 2
.label i = 3
@ -1200,6 +1201,7 @@ main: {
rts
}
//SEG77 test
// test(byte register(X) i, byte zeropage(2) a)
test: {
.label a = 2
//SEG78 [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuxx=vbuz1
@ -1475,6 +1477,7 @@ main: {
rts
}
//SEG77 test
// test(byte register(X) i, byte zeropage(2) a)
test: {
.label a = 2
//SEG78 [28] *((const byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 -- pbuc1_derefidx_vbuxx=vbuz1

View File

@ -44,6 +44,7 @@ plots: {
bcc b1
rts
}
// plot(byte zeropage(4) x, byte zeropage(5) y)
plot: {
.label x = 4
.label y = 5

View File

@ -1154,6 +1154,7 @@ plots: {
rts
}
//SEG42 plot
// plot(byte zeropage($c) x, byte zeropage($d) y)
plot: {
.label _1 = $11
.label _3 = $18
@ -1714,6 +1715,7 @@ plots: {
rts
}
//SEG42 plot
// plot(byte zeropage(4) x, byte zeropage(5) y)
plot: {
.label x = 4
.label y = 5
@ -2295,6 +2297,7 @@ plots: {
rts
}
//SEG42 plot
// plot(byte zeropage(4) x, byte zeropage(5) y)
plot: {
.label x = 4
.label y = 5

View File

@ -31,6 +31,7 @@ main: {
}
// Determine whether to set a char to '*.
// Returns true if i&8!=0 or b=true
// isSet(byte register(X) i, bool zeropage(2) b)
isSet: {
.label b = 2
txa

View File

@ -358,6 +358,7 @@ main: {
//SEG33 isSet
// Determine whether to set a char to '*.
// Returns true if i&8!=0 or b=true
// isSet(byte zeropage(5) i, bool zeropage(4) b)
isSet: {
.label _0 = 8
.label _1 = 9
@ -513,6 +514,7 @@ main: {
//SEG33 isSet
// Determine whether to set a char to '*.
// Returns true if i&8!=0 or b=true
// isSet(byte register(X) i, bool zeropage(2) b)
isSet: {
.label b = 2
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuaa=vbuxx_band_vbuc1
@ -675,6 +677,7 @@ main: {
//SEG33 isSet
// Determine whether to set a char to '*.
// Returns true if i&8!=0 or b=true
// isSet(byte register(X) i, bool zeropage(2) b)
isSet: {
.label b = 2
//SEG34 [18] (byte~) isSet::$0 ← (byte) isSet::i#0 & (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuaa=vbuxx_band_vbuc1

View File

@ -291,6 +291,7 @@ gfx_init_plane_charset8: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff

View File

@ -2434,6 +2434,7 @@ gfx_init_plane_charset8: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte zeropage($d) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -3193,6 +3194,7 @@ gfx_init_plane_charset8: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -4144,6 +4146,7 @@ gfx_init_plane_charset8: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff

View File

@ -258,6 +258,7 @@ gfx_init_chunky: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff

View File

@ -2005,6 +2005,7 @@ gfx_init_chunky: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte zeropage(9) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -2535,6 +2536,7 @@ gfx_init_chunky: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -3264,6 +3266,7 @@ gfx_init_chunky: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff

View File

@ -654,6 +654,7 @@ keyboard_event_scan: {
}
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage(7) keycode)
keyboard_event_pressed: {
.label row_bits = 8
.label keycode = 7
@ -676,6 +677,7 @@ keyboard_event_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(A) rowid)
keyboard_matrix_read: {
tay
lda keyboard_matrix_row_bitmask,y
@ -685,6 +687,7 @@ keyboard_matrix_read: {
rts
}
// Get the VIC screen address from the screen index
// get_vic_screen(byte register(A) idx)
get_vic_screen: {
.label return = 3
cmp #0
@ -729,6 +732,7 @@ get_vic_screen: {
rts
}
// Get the VIC charset/bitmap address from the index
// get_vic_charset(byte register(A) idx)
get_vic_charset: {
.label return = 3
cmp #0
@ -749,6 +753,7 @@ get_vic_charset: {
rts
}
// Get plane address from a plane index (from the form)
// get_plane(byte register(A) idx)
get_plane: {
.label return = $a
cmp #0
@ -1042,6 +1047,7 @@ form_mode: {
}
// Render form preset name in the form
// idx is the ID of the preset
// render_preset_name(byte register(A) idx)
render_preset_name: {
.label name = 3
cmp #0
@ -1153,6 +1159,7 @@ render_preset_name: {
name_11: .text "Standard Charset @"
}
// Print a string at a specific screen position
// print_str_at(byte* zeropage(3) str, byte* zeropage(5) at)
print_str_at: {
.label at = 5
.label str = 3
@ -1202,6 +1209,7 @@ form_render_values: {
}
// Get the screen address of a form field
// field_idx is the index of the field to get the screen address for
// form_field_ptr(byte zeropage(2) field_idx)
form_field_ptr: {
.label return = 3
.label field_idx = 2
@ -1225,6 +1233,7 @@ form_field_ptr: {
}
// Apply a form value preset to the form values
// idx is the ID of the preset
// apply_preset(byte register(A) idx)
apply_preset: {
.label preset = 3
cmp #0
@ -1455,6 +1464,7 @@ form_set_screen: {
}
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage(3) str)
print_str_lines: {
.label str = 3
lda print_set_screen.screen
@ -1544,6 +1554,7 @@ print_cls: {
rts
}
// Set the screen to print on. Also resets current line/char cursor.
// print_set_screen(byte* zeropage($10) screen)
print_set_screen: {
.label screen = $10
rts
@ -1583,6 +1594,7 @@ gfx_init_plane_full: {
rts
}
// Initialize 320*200 1bpp pixel ($2000) plane with identical bytes
// gfx_init_plane_fill(dword zeropage($a) plane_addr, byte zeropage(2) fill)
gfx_init_plane_fill: {
.label _0 = $13
.label _1 = 3
@ -1661,6 +1673,7 @@ gfx_init_plane_fill: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -1986,6 +1999,7 @@ gfx_init_vic_bitmap: {
lines_y: .byte 0, 0, $c7, $c7, 0, 0, $64, $c7, $64, 0
}
// Draw a line on the bitmap
// bitmap_line(byte zeropage(9) x0, byte zeropage($12) x1, byte zeropage($f) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 8
.label yd = 7
@ -2089,6 +2103,7 @@ bitmap_line: {
jsr bitmap_line_xdyi
jmp breturn
}
// bitmap_line_xdyi(byte zeropage($e) x, byte zeropage($f) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyi: {
.label x = $e
.label y = $f
@ -2123,6 +2138,7 @@ bitmap_line_xdyi: {
bne b1
rts
}
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 3
.label plotter_x = 3
@ -2148,6 +2164,7 @@ bitmap_plot: {
sta (_0),y
rts
}
// bitmap_line_ydxi(byte zeropage($e) y, byte register(X) x, byte zeropage($f) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxi: {
.label y = $e
.label y1 = $f
@ -2181,6 +2198,7 @@ bitmap_line_ydxi: {
bne b1
rts
}
// bitmap_line_xdyd(byte zeropage($e) x, byte zeropage($f) y, byte zeropage($12) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyd: {
.label x = $e
.label y = $f
@ -2215,6 +2233,7 @@ bitmap_line_xdyd: {
bne b1
rts
}
// bitmap_line_ydxd(byte zeropage($e) y, byte register(X) x, byte zeropage($f) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxd: {
.label y = $e
.label y1 = $f

View File

@ -15174,6 +15174,7 @@ keyboard_event_scan: {
//SEG375 keyboard_event_pressed
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage($13) keycode)
keyboard_event_pressed: {
.label _0 = $102
.label _1 = $104
@ -15215,6 +15216,7 @@ keyboard_event_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte zeropage($f3) rowid)
keyboard_matrix_read: {
.label return = $106
.label rowid = $f3
@ -15235,6 +15237,7 @@ keyboard_matrix_read: {
}
//SEG387 get_vic_screen
// Get the VIC screen address from the screen index
// get_vic_screen(byte zeropage($14) idx)
get_vic_screen: {
.label return = $15
.label idx = $14
@ -15326,6 +15329,7 @@ get_vic_screen: {
}
//SEG411 get_vic_charset
// Get the VIC charset/bitmap address from the index
// get_vic_charset(byte zeropage($dd) idx)
get_vic_charset: {
.label return = $17
.label idx = $dd
@ -15371,6 +15375,7 @@ get_vic_charset: {
}
//SEG423 get_plane
// Get plane address from a plane index (from the form)
// get_plane(byte zeropage($19) idx)
get_plane: {
.label return = $1a
.label idx = $19
@ -15924,6 +15929,7 @@ form_mode: {
//SEG581 render_preset_name
// Render form preset name in the form
// idx is the ID of the preset
// render_preset_name(byte zeropage($22) idx)
render_preset_name: {
.label idx = $22
.label name = $23
@ -16133,6 +16139,7 @@ render_preset_name: {
}
//SEG635 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage($25) str, byte* zeropage($27) at)
print_str_at: {
.label at = $27
.label str = $25
@ -16240,6 +16247,7 @@ form_render_values: {
//SEG668 form_field_ptr
// Get the screen address of a form field
// field_idx is the index of the field to get the screen address for
// form_field_ptr(byte zeropage($2a) field_idx)
form_field_ptr: {
.label y = $10e
.label x = $111
@ -16279,6 +16287,7 @@ form_field_ptr: {
//SEG675 apply_preset
// Apply a form value preset to the form values
// idx is the ID of the preset
// apply_preset(byte zeropage($109) idx)
apply_preset: {
.label i = $2d
.label idx = $109
@ -16842,6 +16851,7 @@ form_set_screen: {
//SEG842 print_str_lines
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage($32) str)
print_str_lines: {
.label ch = $121
.label str = $32
@ -17011,6 +17021,7 @@ print_cls: {
}
//SEG890 print_set_screen
// Set the screen to print on. Also resets current line/char cursor.
// print_set_screen(byte* zeropage($36) screen)
print_set_screen: {
.label screen = $36
jmp breturn
@ -17183,6 +17194,7 @@ gfx_init_plane_full: {
}
//SEG960 gfx_init_plane_fill
// Initialize 320*200 1bpp pixel ($2000) plane with identical bytes
// gfx_init_plane_fill(dword zeropage($3a) plane_addr, byte zeropage($3e) fill)
gfx_init_plane_fill: {
.label _0 = $124
.label _1 = $128
@ -17335,6 +17347,7 @@ gfx_init_plane_fill: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte zeropage($43) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -18109,6 +18122,7 @@ gfx_init_vic_bitmap: {
}
//SEG1271 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage($139) x0, byte zeropage($13a) x1, byte zeropage($13b) y0, byte zeropage($13c) y1)
bitmap_line: {
.label xd = $140
.label xd_1 = $13d
@ -18419,6 +18433,7 @@ bitmap_line: {
jmp breturn
}
//SEG1397 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage($64) x, byte zeropage($65) y, byte zeropage($63) x1, byte zeropage($62) xd, byte zeropage($61) yd)
bitmap_line_xdyi: {
.label _6 = $143
.label x = $64
@ -18499,6 +18514,7 @@ bitmap_line_xdyi: {
rts
}
//SEG1425 bitmap_plot
// bitmap_plot(byte zeropage($67) x, byte zeropage($68) y)
bitmap_plot: {
.label _0 = $148
.label _1 = $14a
@ -18543,6 +18559,7 @@ bitmap_plot: {
rts
}
//SEG1433 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($6d) y, byte zeropage($6c) x, byte zeropage($6b) y1, byte zeropage($6a) yd, byte zeropage($69) xd)
bitmap_line_ydxi: {
.label _6 = $14b
.label y = $6d
@ -18623,6 +18640,7 @@ bitmap_line_ydxi: {
rts
}
//SEG1461 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($72) x, byte zeropage($73) y, byte zeropage($71) x1, byte zeropage($70) xd, byte zeropage($6f) yd)
bitmap_line_xdyd: {
.label _6 = $14c
.label x = $72
@ -18703,6 +18721,7 @@ bitmap_line_xdyd: {
rts
}
//SEG1489 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($79) y, byte zeropage($78) x, byte zeropage($77) y1, byte zeropage($76) yd, byte zeropage($75) xd)
bitmap_line_ydxd: {
.label _6 = $14d
.label y = $79
@ -22245,6 +22264,7 @@ keyboard_event_scan: {
//SEG375 keyboard_event_pressed
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage(7) keycode)
keyboard_event_pressed: {
.label row_bits = 8
.label keycode = 7
@ -22276,6 +22296,7 @@ keyboard_event_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(A) rowid)
keyboard_matrix_read: {
//SEG383 [219] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuaa
tay
@ -22292,6 +22313,7 @@ keyboard_matrix_read: {
}
//SEG387 get_vic_screen
// Get the VIC screen address from the screen index
// get_vic_screen(byte register(A) idx)
get_vic_screen: {
.label return = 3
//SEG388 [223] if((byte) get_vic_screen::idx#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_vic_screen::@return -- vbuaa_eq_0_then_la1
@ -22375,6 +22397,7 @@ get_vic_screen: {
}
//SEG411 get_vic_charset
// Get the VIC charset/bitmap address from the index
// get_vic_charset(byte register(A) idx)
get_vic_charset: {
.label return = 3
//SEG412 [231] if((byte) get_vic_charset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_vic_charset::@return -- vbuaa_eq_0_then_la1
@ -22416,6 +22439,7 @@ get_vic_charset: {
}
//SEG423 get_plane
// Get plane address from a plane index (from the form)
// get_plane(byte register(A) idx)
get_plane: {
.label return = $a
//SEG424 [237] if((byte) get_plane::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_plane::@return -- vbuaa_eq_0_then_la1
@ -22940,6 +22964,7 @@ form_mode: {
//SEG581 render_preset_name
// Render form preset name in the form
// idx is the ID of the preset
// render_preset_name(byte register(A) idx)
render_preset_name: {
.label name = 3
//SEG582 [307] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_preset_name::@22 -- vbuaa_eq_0_then_la1
@ -23133,6 +23158,7 @@ render_preset_name: {
}
//SEG635 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage(3) str, byte* zeropage(5) at)
print_str_at: {
.label at = 5
.label str = 3
@ -23230,6 +23256,7 @@ form_render_values: {
//SEG668 form_field_ptr
// Get the screen address of a form field
// field_idx is the index of the field to get the screen address for
// form_field_ptr(byte zeropage(2) field_idx)
form_field_ptr: {
.label return = 3
.label field_idx = 2
@ -23262,6 +23289,7 @@ form_field_ptr: {
//SEG675 apply_preset
// Apply a form value preset to the form values
// idx is the ID of the preset
// apply_preset(byte register(A) idx)
apply_preset: {
.label preset = 3
//SEG676 [346] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto apply_preset::@22 -- vbuaa_eq_0_then_la1
@ -23752,6 +23780,7 @@ form_set_screen: {
//SEG842 print_str_lines
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage(3) str)
print_str_lines: {
.label str = 3
//SEG843 [420] (byte*~) print_char_cursor#77 ← (byte*) print_set_screen::screen#2 -- pbuz1=pbuz2
@ -23916,6 +23945,7 @@ print_cls: {
}
//SEG890 print_set_screen
// Set the screen to print on. Also resets current line/char cursor.
// print_set_screen(byte* zeropage($10) screen)
print_set_screen: {
.label screen = $10
jmp breturn
@ -24088,6 +24118,7 @@ gfx_init_plane_full: {
}
//SEG960 gfx_init_plane_fill
// Initialize 320*200 1bpp pixel ($2000) plane with identical bytes
// gfx_init_plane_fill(dword zeropage($a) plane_addr, byte zeropage(2) fill)
gfx_init_plane_fill: {
.label _0 = $13
.label _1 = 3
@ -24227,6 +24258,7 @@ gfx_init_plane_fill: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -24955,6 +24987,7 @@ gfx_init_vic_bitmap: {
}
//SEG1271 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage(9) x0, byte zeropage($12) x1, byte zeropage($f) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 8
.label yd = 7
@ -25212,6 +25245,7 @@ bitmap_line: {
jmp breturn
}
//SEG1397 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage($e) x, byte zeropage($f) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyi: {
.label x = $e
.label y = $f
@ -25287,6 +25321,7 @@ bitmap_line_xdyi: {
rts
}
//SEG1425 bitmap_plot
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 3
.label plotter_x = 3
@ -25323,6 +25358,7 @@ bitmap_plot: {
rts
}
//SEG1433 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($e) y, byte register(X) x, byte zeropage($f) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxi: {
.label y = $e
.label y1 = $f
@ -25397,6 +25433,7 @@ bitmap_line_ydxi: {
rts
}
//SEG1461 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($e) x, byte zeropage($f) y, byte zeropage($12) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyd: {
.label x = $e
.label y = $f
@ -25472,6 +25509,7 @@ bitmap_line_xdyd: {
rts
}
//SEG1489 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($e) y, byte register(X) x, byte zeropage($f) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxd: {
.label y = $e
.label y1 = $f
@ -27334,18 +27372,18 @@ Removing instruction b37:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing unreachable instruction jmp b7
Succesful ASM optimization Pass5UnreachableCodeElimination
Fixing long branch [762] beq b5 to bne
Fixing long branch [766] beq b6 to bne
Fixing long branch [770] beq b7 to bne
Fixing long branch [774] beq b8 to bne
Fixing long branch [760] beq b4 to bne
Fixing long branch [780] beq b9 to bne
Fixing long branch [784] beq b10 to bne
Fixing long branch [788] beq b11 to bne
Fixing long branch [792] beq b12 to bne
Fixing long branch [758] beq b3 to bne
Fixing long branch [798] beq b13 to bne
Fixing long branch [1346] bmi b2 to bpl
Fixing long branch [767] beq b5 to bne
Fixing long branch [771] beq b6 to bne
Fixing long branch [775] beq b7 to bne
Fixing long branch [779] beq b8 to bne
Fixing long branch [765] beq b4 to bne
Fixing long branch [785] beq b9 to bne
Fixing long branch [789] beq b10 to bne
Fixing long branch [793] beq b11 to bne
Fixing long branch [797] beq b12 to bne
Fixing long branch [763] beq b3 to bne
Fixing long branch [803] beq b13 to bne
Fixing long branch [1355] bmi b2 to bpl
FINAL SYMBOL TABLE
(label) @68
@ -30086,6 +30124,7 @@ keyboard_event_scan: {
//SEG375 keyboard_event_pressed
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage(7) keycode)
keyboard_event_pressed: {
.label row_bits = 8
.label keycode = 7
@ -30115,6 +30154,7 @@ keyboard_event_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(A) rowid)
keyboard_matrix_read: {
//SEG383 [219] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuaa
tay
@ -30129,6 +30169,7 @@ keyboard_matrix_read: {
}
//SEG387 get_vic_screen
// Get the VIC screen address from the screen index
// get_vic_screen(byte register(A) idx)
get_vic_screen: {
.label return = 3
//SEG388 [223] if((byte) get_vic_screen::idx#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_vic_screen::@return -- vbuaa_eq_0_then_la1
@ -30197,6 +30238,7 @@ get_vic_screen: {
}
//SEG411 get_vic_charset
// Get the VIC charset/bitmap address from the index
// get_vic_charset(byte register(A) idx)
get_vic_charset: {
.label return = 3
//SEG412 [231] if((byte) get_vic_charset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_vic_charset::@return -- vbuaa_eq_0_then_la1
@ -30229,6 +30271,7 @@ get_vic_charset: {
}
//SEG423 get_plane
// Get plane address from a plane index (from the form)
// get_plane(byte register(A) idx)
get_plane: {
.label return = $a
//SEG424 [237] if((byte) get_plane::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_plane::@return -- vbuaa_eq_0_then_la1
@ -30680,6 +30723,7 @@ form_mode: {
//SEG581 render_preset_name
// Render form preset name in the form
// idx is the ID of the preset
// render_preset_name(byte register(A) idx)
render_preset_name: {
.label name = 3
//SEG582 [307] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_preset_name::@22 -- vbuaa_eq_0_then_la1
@ -30845,6 +30889,7 @@ render_preset_name: {
}
//SEG635 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage(3) str, byte* zeropage(5) at)
print_str_at: {
.label at = 5
.label str = 3
@ -30927,6 +30972,7 @@ form_render_values: {
//SEG668 form_field_ptr
// Get the screen address of a form field
// field_idx is the index of the field to get the screen address for
// form_field_ptr(byte zeropage(2) field_idx)
form_field_ptr: {
.label return = 3
.label field_idx = 2
@ -30957,6 +31003,7 @@ form_field_ptr: {
//SEG675 apply_preset
// Apply a form value preset to the form values
// idx is the ID of the preset
// apply_preset(byte register(A) idx)
apply_preset: {
.label preset = 3
//SEG676 [346] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto apply_preset::@22 -- vbuaa_eq_0_then_la1
@ -31354,6 +31401,7 @@ form_set_screen: {
//SEG842 print_str_lines
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage(3) str)
print_str_lines: {
.label str = 3
//SEG843 [420] (byte*~) print_char_cursor#77 ← (byte*) print_set_screen::screen#2 -- pbuz1=pbuz2
@ -31491,6 +31539,7 @@ print_cls: {
}
//SEG890 print_set_screen
// Set the screen to print on. Also resets current line/char cursor.
// print_set_screen(byte* zeropage($10) screen)
print_set_screen: {
.label screen = $10
//SEG891 print_set_screen::@return
@ -31600,6 +31649,7 @@ gfx_init_plane_full: {
}
//SEG960 gfx_init_plane_fill
// Initialize 320*200 1bpp pixel ($2000) plane with identical bytes
// gfx_init_plane_fill(dword zeropage($a) plane_addr, byte zeropage(2) fill)
gfx_init_plane_fill: {
.label _0 = $13
.label _1 = 3
@ -31720,6 +31770,7 @@ gfx_init_plane_fill: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -32314,6 +32365,7 @@ gfx_init_vic_bitmap: {
}
//SEG1271 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage(9) x0, byte zeropage($12) x1, byte zeropage($f) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 8
.label yd = 7
@ -32543,6 +32595,7 @@ bitmap_line: {
jmp breturn
}
//SEG1397 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage($e) x, byte zeropage($f) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyi: {
.label x = $e
.label y = $f
@ -32605,6 +32658,7 @@ bitmap_line_xdyi: {
rts
}
//SEG1425 bitmap_plot
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 3
.label plotter_x = 3
@ -32638,6 +32692,7 @@ bitmap_plot: {
rts
}
//SEG1433 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($e) y, byte register(X) x, byte zeropage($f) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxi: {
.label y = $e
.label y1 = $f
@ -32699,6 +32754,7 @@ bitmap_line_ydxi: {
rts
}
//SEG1461 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($e) x, byte zeropage($f) y, byte zeropage($12) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyd: {
.label x = $e
.label y = $f
@ -32761,6 +32817,7 @@ bitmap_line_xdyd: {
rts
}
//SEG1489 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($e) y, byte register(X) x, byte zeropage($f) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxd: {
.label y = $e
.label y1 = $f

View File

@ -452,6 +452,7 @@ mode_ctrl: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(Y) key)
keyboard_key_pressed: {
.label colidx = 7
tya
@ -472,6 +473,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(Y) rowid)
keyboard_matrix_read: {
lda keyboard_matrix_row_bitmask,y
sta CIA1_PORT_A
@ -482,6 +484,7 @@ keyboard_matrix_read: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -1546,6 +1549,7 @@ mode_stdbitmap: {
lines_y: .byte 0, 0, $c7, $c7, 0, 0, $64, $c7, $64, 0
}
// Draw a line on the bitmap
// bitmap_line(byte zeropage(9) x0, byte zeropage($c) x1, byte zeropage($b) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 8
.label yd = 7
@ -1649,6 +1653,7 @@ bitmap_line: {
jsr bitmap_line_xdyi
jmp breturn
}
// bitmap_line_xdyi(byte zeropage($a) x, byte zeropage($b) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyi: {
.label x = $a
.label y = $b
@ -1683,6 +1688,7 @@ bitmap_line_xdyi: {
bne b1
rts
}
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 2
.label plotter_x = 2
@ -1708,6 +1714,7 @@ bitmap_plot: {
sta (_0),y
rts
}
// bitmap_line_ydxi(byte zeropage($a) y, byte register(X) x, byte zeropage($b) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxi: {
.label y = $a
.label y1 = $b
@ -1741,6 +1748,7 @@ bitmap_line_ydxi: {
bne b1
rts
}
// bitmap_line_xdyd(byte zeropage($a) x, byte zeropage($b) y, byte zeropage($c) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyd: {
.label x = $a
.label y = $b
@ -1775,6 +1783,7 @@ bitmap_line_xdyd: {
bne b1
rts
}
// bitmap_line_ydxd(byte zeropage($a) y, byte register(X) x, byte zeropage($b) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxd: {
.label y = $a
.label y1 = $b
@ -2223,6 +2232,7 @@ mode_stdchar: {
}
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage(2) str)
print_str_lines: {
.label str = 2
lda #<menu.SCREEN

View File

@ -13829,6 +13829,7 @@ mode_ctrl: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte zeropage($e) key)
keyboard_key_pressed: {
.label _2 = $d0
.label colidx = $cc
@ -13896,6 +13897,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte zeropage($ce) rowid)
keyboard_matrix_read: {
.label return = $d2
.label rowid = $ce
@ -13918,6 +13920,7 @@ keyboard_matrix_read: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte zeropage($f) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -16138,6 +16141,7 @@ mode_stdbitmap: {
}
//SEG1100 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage($f8) x0, byte zeropage($f9) x1, byte zeropage($fa) y0, byte zeropage($fb) y1)
bitmap_line: {
.label xd = $ff
.label xd_1 = $fc
@ -16448,6 +16452,7 @@ bitmap_line: {
jmp breturn
}
//SEG1226 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage($64) x, byte zeropage($65) y, byte zeropage($63) x1, byte zeropage($62) xd, byte zeropage($61) yd)
bitmap_line_xdyi: {
.label _6 = $102
.label x = $64
@ -16528,6 +16533,7 @@ bitmap_line_xdyi: {
rts
}
//SEG1254 bitmap_plot
// bitmap_plot(byte zeropage($67) x, byte zeropage($68) y)
bitmap_plot: {
.label _0 = $107
.label _1 = $109
@ -16572,6 +16578,7 @@ bitmap_plot: {
rts
}
//SEG1262 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($6d) y, byte zeropage($6c) x, byte zeropage($6b) y1, byte zeropage($6a) yd, byte zeropage($69) xd)
bitmap_line_ydxi: {
.label _6 = $10a
.label y = $6d
@ -16652,6 +16659,7 @@ bitmap_line_ydxi: {
rts
}
//SEG1290 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($72) x, byte zeropage($73) y, byte zeropage($71) x1, byte zeropage($70) xd, byte zeropage($6f) yd)
bitmap_line_xdyd: {
.label _6 = $10b
.label x = $72
@ -16732,6 +16740,7 @@ bitmap_line_xdyd: {
rts
}
//SEG1318 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($79) y, byte zeropage($78) x, byte zeropage($77) y1, byte zeropage($76) yd, byte zeropage($75) xd)
bitmap_line_ydxd: {
.label _6 = $10c
.label y = $79
@ -17695,6 +17704,7 @@ mode_stdchar: {
//SEG1607 print_str_lines
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage($99) str)
print_str_lines: {
.label ch = $127
.label str = $99
@ -20580,6 +20590,7 @@ mode_ctrl: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(Y) key)
keyboard_key_pressed: {
.label colidx = 7
//SEG392 [212] (byte) keyboard_key_pressed::colidx#0 ← (byte) keyboard_key_pressed::key#20 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuyy_band_vbuc1
@ -20615,6 +20626,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(Y) rowid)
keyboard_matrix_read: {
//SEG403 [220] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuyy
lda keyboard_matrix_row_bitmask,y
@ -20632,6 +20644,7 @@ keyboard_matrix_read: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -22680,6 +22693,7 @@ mode_stdbitmap: {
}
//SEG1100 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage(9) x0, byte zeropage($c) x1, byte zeropage($b) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 8
.label yd = 7
@ -22937,6 +22951,7 @@ bitmap_line: {
jmp breturn
}
//SEG1226 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage($a) x, byte zeropage($b) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyi: {
.label x = $a
.label y = $b
@ -23012,6 +23027,7 @@ bitmap_line_xdyi: {
rts
}
//SEG1254 bitmap_plot
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 2
.label plotter_x = 2
@ -23048,6 +23064,7 @@ bitmap_plot: {
rts
}
//SEG1262 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($a) y, byte register(X) x, byte zeropage($b) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxi: {
.label y = $a
.label y1 = $b
@ -23122,6 +23139,7 @@ bitmap_line_ydxi: {
rts
}
//SEG1290 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($a) x, byte zeropage($b) y, byte zeropage($c) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyd: {
.label x = $a
.label y = $b
@ -23197,6 +23215,7 @@ bitmap_line_xdyd: {
rts
}
//SEG1318 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($a) y, byte register(X) x, byte zeropage($b) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxd: {
.label y = $a
.label y1 = $b
@ -24053,6 +24072,7 @@ mode_stdchar: {
//SEG1607 print_str_lines
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage(2) str)
print_str_lines: {
.label str = 2
//SEG1608 [866] phi from print_str_lines to print_str_lines::@1 [phi:print_str_lines->print_str_lines::@1]
@ -27493,6 +27513,7 @@ mode_ctrl: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(Y) key)
keyboard_key_pressed: {
.label colidx = 7
//SEG392 [212] (byte) keyboard_key_pressed::colidx#0 ← (byte) keyboard_key_pressed::key#20 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuyy_band_vbuc1
@ -27524,6 +27545,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(Y) rowid)
keyboard_matrix_read: {
//SEG403 [220] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuyy
lda keyboard_matrix_row_bitmask,y
@ -27539,6 +27561,7 @@ keyboard_matrix_read: {
// Set the memory pointed to by CPU BANK 1 SEGMENT ($4000-$7fff)
// This sets which actual memory is addressed when the CPU reads/writes to $4000-$7fff
// The actual memory addressed will be $4000*cpuSegmentIdx
// dtvSetCpuBankSegment1(byte register(A) cpuBankIdx)
dtvSetCpuBankSegment1: {
// Move CPU BANK 1 SEGMENT ($4000-$7fff)
.label cpuBank = $ff
@ -29296,6 +29319,7 @@ mode_stdbitmap: {
}
//SEG1100 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage(9) x0, byte zeropage($c) x1, byte zeropage($b) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 8
.label yd = 7
@ -29525,6 +29549,7 @@ bitmap_line: {
jmp breturn
}
//SEG1226 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage($a) x, byte zeropage($b) y, byte zeropage(9) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyi: {
.label x = $a
.label y = $b
@ -29587,6 +29612,7 @@ bitmap_line_xdyi: {
rts
}
//SEG1254 bitmap_plot
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 2
.label plotter_x = 2
@ -29620,6 +29646,7 @@ bitmap_plot: {
rts
}
//SEG1262 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($a) y, byte register(X) x, byte zeropage($b) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxi: {
.label y = $a
.label y1 = $b
@ -29681,6 +29708,7 @@ bitmap_line_ydxi: {
rts
}
//SEG1290 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($a) x, byte zeropage($b) y, byte zeropage($c) x1, byte zeropage(8) xd, byte zeropage(7) yd)
bitmap_line_xdyd: {
.label x = $a
.label y = $b
@ -29743,6 +29771,7 @@ bitmap_line_xdyd: {
rts
}
//SEG1318 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($a) y, byte register(X) x, byte zeropage($b) y1, byte zeropage(7) yd, byte zeropage(8) xd)
bitmap_line_ydxd: {
.label y = $a
.label y1 = $b
@ -30480,6 +30509,7 @@ mode_stdchar: {
//SEG1607 print_str_lines
// Print a number of zero-terminated strings, each followed by a newline.
// The sequence of lines is terminated by another zero.
// print_str_lines(byte* zeropage(2) str)
print_str_lines: {
.label str = 2
//SEG1608 [866] phi from print_str_lines to print_str_lines::@1 [phi:print_str_lines->print_str_lines::@1]

View File

@ -20,6 +20,7 @@ main: {
jsr line
rts
}
// line(byte zeropage(2) x1)
line: {
.label x1 = 2
b1:

View File

@ -293,6 +293,7 @@ main: {
rts
}
//SEG25 line
// line(byte zeropage(2) x1)
line: {
.label x = 3
.label x1 = 2
@ -412,6 +413,7 @@ main: {
rts
}
//SEG25 line
// line(byte zeropage(2) x1)
line: {
.label x1 = 2
//SEG26 [10] phi from line line::@1 to line::@1 [phi:line/line::@1->line::@1]
@ -551,6 +553,7 @@ main: {
rts
}
//SEG25 line
// line(byte zeropage(2) x1)
line: {
.label x1 = 2
//SEG26 [10] phi from line line::@1 to line::@1 [phi:line/line::@1->line::@1]

View File

@ -352,6 +352,7 @@ render_score: {
// - offset: offset on the screen
// - bcd: The BCD-value to render
// - only_low: if non-zero only renders the low digit
// render_bcd(byte* zeropage(5) screen, word zeropage(7) offset, byte register(X) bcd, byte register(Y) only_low)
render_bcd: {
.const ZERO_CHAR = $35
.label screen = 5
@ -574,6 +575,7 @@ render_playfield: {
// Perform any movement of the current piece
// key_event is the next keyboard_event() og $ff if no keyboard event is pending
// Returns a byte signaling whether rendering is needed. (0 no render, >0 render needed)
// play_movement(byte zeropage($29) key_event)
play_movement: {
.label render = 9
.label return = 9
@ -604,6 +606,7 @@ play_movement: {
}
// Rotate the current piece based on key-presses
// Return non-zero if a render is needed
// play_move_rotate(byte register(A) key_event)
play_move_rotate: {
.label orientation = $a
cmp #KEY_Z
@ -653,6 +656,7 @@ play_move_rotate: {
}
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
// Returns information about the type of the collision detected
// play_collision(byte zeropage($c) xpos, byte zeropage($b) ypos, byte register(X) orientation)
play_collision: {
.label xpos = $c
.label ypos = $b
@ -746,6 +750,7 @@ play_collision: {
}
// Move left/right or rotate the current piece
// Return non-zero if a render is needed
// play_move_leftright(byte register(A) key_event)
play_move_leftright: {
// Handle keyboard events
cmp #KEY_COMMA
@ -792,6 +797,7 @@ play_move_leftright: {
}
// Move down the current piece
// Return non-zero if a render is needed
// play_move_down(byte register(A) key_event)
play_move_down: {
inc current_movedown_counter
cmp #KEY_SPACE
@ -913,6 +919,7 @@ sid_rnd: {
rts
}
// Update the score based on the number of lines removed
// play_update_score(byte register(X) removed)
play_update_score: {
.label lines_before = 4
.label add_bcd = $2b
@ -1139,6 +1146,7 @@ play_lock_current: {
}
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage(9) keycode)
keyboard_event_pressed: {
.label row_bits = $a
.label keycode = 9
@ -1283,6 +1291,7 @@ keyboard_event_scan: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
lda keyboard_matrix_row_bitmask,x
sta CIA1_PORT_A
@ -1509,6 +1518,7 @@ render_init: {
}
// Copy the original screen data to the passed screen
// Also copies colors to $d800
// render_screen_original(byte* zeropage($11) screen)
render_screen_original: {
.const SPACE = 0
.label screen = $11

View File

@ -13620,6 +13620,7 @@ render_score: {
// - offset: offset on the screen
// - bcd: The BCD-value to render
// - only_low: if non-zero only renders the low digit
// render_bcd(byte* zeropage(7) screen, word zeropage(9) offset, byte zeropage($c) bcd, byte zeropage($b) only_low)
render_bcd: {
.const ZERO_CHAR = $35
.label _3 = $81
@ -14076,6 +14077,7 @@ render_playfield: {
// Perform any movement of the current piece
// key_event is the next keyboard_event() og $ff if no keyboard event is pending
// Returns a byte signaling whether rendering is needed. (0 no render, >0 render needed)
// play_movement(byte zeropage($7e) key_event)
play_movement: {
.label _0 = $92
.label _3 = $95
@ -14165,6 +14167,7 @@ play_movement: {
//SEG422 play_move_rotate
// Rotate the current piece based on key-presses
// Return non-zero if a render is needed
// play_move_rotate(byte zeropage($97) key_event)
play_move_rotate: {
.label _2 = $9a
.label _4 = $9d
@ -14288,6 +14291,7 @@ play_move_rotate: {
//SEG462 play_collision
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
// Returns information about the type of the collision detected
// play_collision(byte zeropage($2f) xpos, byte zeropage($2e) ypos, byte zeropage($2d) orientation)
play_collision: {
.label _7 = $a3
.label xpos = $2f
@ -14476,6 +14480,7 @@ play_collision: {
//SEG520 play_move_leftright
// Move left/right or rotate the current piece
// Return non-zero if a render is needed
// play_move_leftright(byte zeropage($93) key_event)
play_move_leftright: {
.label _4 = $a5
.label _8 = $a7
@ -14607,6 +14612,7 @@ play_move_leftright: {
//SEG566 play_move_down
// Move down the current piece
// Return non-zero if a render is needed
// play_move_down(byte zeropage($90) key_event)
play_move_down: {
.label _2 = $a9
.label _12 = $ab
@ -15019,6 +15025,7 @@ sid_rnd: {
}
//SEG742 play_update_score
// Update the score based on the number of lines removed
// play_update_score(byte zeropage($ae) removed)
play_update_score: {
.label _2 = $b6
.label _4 = $b8
@ -15503,6 +15510,7 @@ play_lock_current: {
//SEG896 keyboard_event_pressed
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage($58) keycode)
keyboard_event_pressed: {
.label _0 = $c5
.label _1 = $c7
@ -15904,6 +15912,7 @@ keyboard_event_scan: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte zeropage($c9) rowid)
keyboard_matrix_read: {
.label return = $d9
.label rowid = $c9
@ -16347,6 +16356,7 @@ render_init: {
//SEG1151 render_screen_original
// Copy the original screen data to the passed screen
// Also copies colors to $d800
// render_screen_original(byte* zeropage($71) screen)
render_screen_original: {
.const SPACE = 0
.label screen = $71
@ -18814,6 +18824,7 @@ render_score: {
// - offset: offset on the screen
// - bcd: The BCD-value to render
// - only_low: if non-zero only renders the low digit
// render_bcd(byte* zeropage(5) screen, word zeropage(7) offset, byte register(X) bcd, byte register(Y) only_low)
render_bcd: {
.const ZERO_CHAR = $35
.label screen = 5
@ -19232,6 +19243,7 @@ render_playfield: {
// Perform any movement of the current piece
// key_event is the next keyboard_event() og $ff if no keyboard event is pending
// Returns a byte signaling whether rendering is needed. (0 no render, >0 render needed)
// play_movement(byte zeropage($29) key_event)
play_movement: {
.label render = 9
.label return = 9
@ -19299,6 +19311,7 @@ play_movement: {
//SEG422 play_move_rotate
// Rotate the current piece based on key-presses
// Return non-zero if a render is needed
// play_move_rotate(byte register(A) key_event)
play_move_rotate: {
.label orientation = $a
//SEG423 [182] if((byte) play_move_rotate::key_event#0==(const byte) KEY_Z#0) goto play_move_rotate::@1 -- vbuaa_eq_vbuc1_then_la1
@ -19402,6 +19415,7 @@ play_move_rotate: {
//SEG462 play_collision
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
// Returns information about the type of the collision detected
// play_collision(byte zeropage($c) xpos, byte zeropage($b) ypos, byte register(X) orientation)
play_collision: {
.label xpos = $c
.label ypos = $b
@ -19570,6 +19584,7 @@ play_collision: {
//SEG520 play_move_leftright
// Move left/right or rotate the current piece
// Return non-zero if a render is needed
// play_move_leftright(byte register(A) key_event)
play_move_leftright: {
//SEG521 [225] if((byte) play_move_leftright::key_event#0==(const byte) KEY_COMMA#0) goto play_move_leftright::@1 -- vbuaa_eq_vbuc1_then_la1
// Handle keyboard events
@ -19680,6 +19695,7 @@ play_move_leftright: {
//SEG566 play_move_down
// Move down the current piece
// Return non-zero if a render is needed
// play_move_down(byte register(A) key_event)
play_move_down: {
//SEG567 [247] (byte) current_movedown_counter#12 ← ++ (byte) current_movedown_counter#16 -- vbuz1=_inc_vbuz1
inc current_movedown_counter
@ -20043,6 +20059,7 @@ sid_rnd: {
}
//SEG742 play_update_score
// Update the score based on the number of lines removed
// play_update_score(byte register(X) removed)
play_update_score: {
.label lines_before = 4
.label add_bcd = $2b
@ -20492,6 +20509,7 @@ play_lock_current: {
//SEG896 keyboard_event_pressed
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage(9) keycode)
keyboard_event_pressed: {
.label row_bits = $a
.label keycode = 9
@ -20831,6 +20849,7 @@ keyboard_event_scan: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
//SEG1024 [448] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
@ -21241,6 +21260,7 @@ render_init: {
//SEG1151 render_screen_original
// Copy the original screen data to the passed screen
// Also copies colors to $d800
// render_screen_original(byte* zeropage($11) screen)
render_screen_original: {
.const SPACE = 0
.label screen = $11
@ -24274,6 +24294,7 @@ render_score: {
// - offset: offset on the screen
// - bcd: The BCD-value to render
// - only_low: if non-zero only renders the low digit
// render_bcd(byte* zeropage(5) screen, word zeropage(7) offset, byte register(X) bcd, byte register(Y) only_low)
render_bcd: {
.const ZERO_CHAR = $35
.label screen = 5
@ -24634,6 +24655,7 @@ render_playfield: {
// Perform any movement of the current piece
// key_event is the next keyboard_event() og $ff if no keyboard event is pending
// Returns a byte signaling whether rendering is needed. (0 no render, >0 render needed)
// play_movement(byte zeropage($29) key_event)
play_movement: {
.label render = 9
.label return = 9
@ -24692,6 +24714,7 @@ play_movement: {
//SEG422 play_move_rotate
// Rotate the current piece based on key-presses
// Return non-zero if a render is needed
// play_move_rotate(byte register(A) key_event)
play_move_rotate: {
.label orientation = $a
//SEG423 [182] if((byte) play_move_rotate::key_event#0==(const byte) KEY_Z#0) goto play_move_rotate::@1 -- vbuaa_eq_vbuc1_then_la1
@ -24781,6 +24804,7 @@ play_move_rotate: {
//SEG462 play_collision
// Test if there is a collision between the current piece moved to (x, y) and anything on the playfield or the playfield boundaries
// Returns information about the type of the collision detected
// play_collision(byte zeropage($c) xpos, byte zeropage($b) ypos, byte register(X) orientation)
play_collision: {
.label xpos = $c
.label ypos = $b
@ -24932,6 +24956,7 @@ play_collision: {
//SEG520 play_move_leftright
// Move left/right or rotate the current piece
// Return non-zero if a render is needed
// play_move_leftright(byte register(A) key_event)
play_move_leftright: {
//SEG521 [225] if((byte) play_move_leftright::key_event#0==(const byte) KEY_COMMA#0) goto play_move_leftright::@1 -- vbuaa_eq_vbuc1_then_la1
// Handle keyboard events
@ -25024,6 +25049,7 @@ play_move_leftright: {
//SEG566 play_move_down
// Move down the current piece
// Return non-zero if a render is needed
// play_move_down(byte register(A) key_event)
play_move_down: {
//SEG567 [247] (byte) current_movedown_counter#12 ← ++ (byte) current_movedown_counter#16 -- vbuz1=_inc_vbuz1
inc current_movedown_counter
@ -25321,6 +25347,7 @@ sid_rnd: {
}
//SEG742 play_update_score
// Update the score based on the number of lines removed
// play_update_score(byte register(X) removed)
play_update_score: {
.label lines_before = 4
.label add_bcd = $2b
@ -25701,6 +25728,7 @@ play_lock_current: {
//SEG896 keyboard_event_pressed
// Determine if a specific key is currently pressed based on the last keyboard_event_scan()
// Returns 0 is not pressed and non-0 if pressed
// keyboard_event_pressed(byte zeropage(9) keycode)
keyboard_event_pressed: {
.label row_bits = $a
.label keycode = 9
@ -25972,6 +26000,7 @@ keyboard_event_scan: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
//SEG1024 [448] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
@ -26326,6 +26355,7 @@ render_init: {
//SEG1151 render_screen_original
// Copy the original screen data to the passed screen
// Also copies colors to $d800
// render_screen_original(byte* zeropage($11) screen)
render_screen_original: {
.const SPACE = 0
.label screen = $11

View File

@ -29,6 +29,7 @@ line: {
beq b3
rts
}
// plot(byte register(X) x)
plot: {
ldy plots,x
lda SCREEN,y

View File

@ -391,6 +391,7 @@ line: {
rts
}
//SEG37 plot
// plot(byte zeropage(4) x)
plot: {
.label _0 = 6
.label x = 4
@ -537,6 +538,7 @@ line: {
rts
}
//SEG37 plot
// plot(byte register(X) x)
plot: {
//SEG38 [19] (byte) plot::idx#0 ← *((const byte*) plots#0 + (byte) plot::x#1) -- vbuyy=pbuc1_derefidx_vbuxx
ldy plots,x
@ -705,6 +707,7 @@ line: {
rts
}
//SEG37 plot
// plot(byte register(X) x)
plot: {
//SEG38 [19] (byte) plot::idx#0 ← *((const byte*) plots#0 + (byte) plot::x#1) -- vbuyy=pbuc1_derefidx_vbuxx
ldy plots,x

View File

@ -16,6 +16,7 @@ main: {
sta screen+2
rts
}
// sum(byte register(A) b)
sum: {
clc
adc #main.reverse

View File

@ -336,6 +336,7 @@ main: {
rts
}
//SEG34 sum
// sum(byte zeropage(2) b)
sum: {
.label return = 3
.label return_1 = 5
@ -451,6 +452,7 @@ main: {
rts
}
//SEG34 sum
// sum(byte register(A) b)
sum: {
//SEG35 [19] (byte) sum::return#3 ← (const byte) main::reverse#0 + (byte) sum::b#3 -- vbuaa=vbuc1_plus_vbuaa
clc
@ -585,6 +587,7 @@ main: {
rts
}
//SEG34 sum
// sum(byte register(A) b)
sum: {
//SEG35 [19] (byte) sum::return#3 ← (const byte) main::reverse#0 + (byte) sum::b#3 -- vbuaa=vbuc1_plus_vbuaa
clc

View File

@ -68,6 +68,7 @@ test_sbytes: {
msg3: .text "-(0+2-4)=2@"
msg4: .text "-127-127=2@"
}
// assert_sbyte(byte* zeropage(2) msg, signed byte register(X) b, signed byte zeropage(4) c)
assert_sbyte: {
.label msg = 2
.label c = 4
@ -105,6 +106,7 @@ assert_sbyte: {
str2: .text "ok@"
}
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
b1:
@ -197,6 +199,7 @@ test_bytes: {
msg1: .text "0+2=2@"
msg2: .text "0+2-4=254@"
}
// assert_byte(byte* zeropage(2) msg, byte register(X) b, byte zeropage(4) c)
assert_byte: {
.label msg = 2
.label c = 4

View File

@ -1506,6 +1506,7 @@ test_sbytes: {
msg4: .text "-127-127=2@"
}
//SEG59 assert_sbyte
// assert_sbyte(byte* zeropage(2) msg, signed byte zeropage(4) b, signed byte zeropage(5) c)
assert_sbyte: {
.label msg = 2
.label b = 4
@ -1601,6 +1602,7 @@ assert_sbyte: {
}
//SEG93 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(8) str)
print_str: {
.label str = 8
//SEG94 [37] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -1764,6 +1766,7 @@ test_bytes: {
msg2: .text "0+2-4=254@"
}
//SEG141 assert_byte
// assert_byte(byte* zeropage($c) msg, byte zeropage($e) b, byte zeropage($f) c)
assert_byte: {
.label msg = $c
.label b = $e
@ -2142,6 +2145,7 @@ test_sbytes: {
msg4: .text "-127-127=2@"
}
//SEG59 assert_sbyte
// assert_sbyte(byte* zeropage(2) msg, signed byte register(X) b, signed byte zeropage(4) c)
assert_sbyte: {
.label msg = 2
.label c = 4
@ -2231,6 +2235,7 @@ assert_sbyte: {
}
//SEG93 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG94 [37] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -2391,6 +2396,7 @@ test_bytes: {
msg2: .text "0+2-4=254@"
}
//SEG141 assert_byte
// assert_byte(byte* zeropage(2) msg, byte register(X) b, byte zeropage(4) c)
assert_byte: {
.label msg = 2
.label c = 4
@ -2887,6 +2893,7 @@ test_sbytes: {
msg4: .text "-127-127=2@"
}
//SEG59 assert_sbyte
// assert_sbyte(byte* zeropage(2) msg, signed byte register(X) b, signed byte zeropage(4) c)
assert_sbyte: {
.label msg = 2
.label c = 4
@ -2958,6 +2965,7 @@ assert_sbyte: {
}
//SEG93 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG94 [37] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -3098,6 +3106,7 @@ test_bytes: {
msg2: .text "0+2-4=254@"
}
//SEG141 assert_byte
// assert_byte(byte* zeropage(2) msg, byte register(X) b, byte zeropage(4) c)
assert_byte: {
.label msg = 2
.label c = 4

View File

@ -342,6 +342,7 @@ debug_print: {
rts
}
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte register(X) b, byte* zeropage(6) at)
print_sbyte_at: {
.label at = 6
cpx #0
@ -368,6 +369,7 @@ print_sbyte_at: {
jmp b2
}
// Print a single char
// print_char_at(byte zeropage(8) ch, byte* zeropage(6) at)
print_char_at: {
.label at = 6
.label ch = 8
@ -377,6 +379,7 @@ print_char_at: {
rts
}
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage(6) at)
print_byte_at: {
.label at = 6
txa
@ -404,6 +407,7 @@ print_byte_at: {
// The rotation matrix is prepared by calling prepare_matrix()
// The passed points must be in the interval [-$3f;$3f].
// Implemented in assembler to utilize seriously fast multiplication
// rotate_matrix(signed byte zeropage(5) x, signed byte register(Y) y, signed byte register(X) z)
rotate_matrix: {
.label x = 5
lda x
@ -545,6 +549,7 @@ store_matrix: {
// Prepare the 3x3 rotation matrix into rotation_matrix[]
// Angles sx, sy, sz are based on 2*PI=$100
// Method described in C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// calculate_matrix(signed byte register(X) sx, signed byte zeropage(3) sy)
calculate_matrix: {
.label sy = 3
.label t1 = 4
@ -1051,6 +1056,7 @@ debug_print_init: {
str11: .text "yp@"
}
// Print a string at a specific screen position
// print_str_at(byte* zeropage(6) str, byte* zeropage(9) at)
print_str_at: {
.label at = 9
.label str = 6

View File

@ -6414,6 +6414,7 @@ debug_print: {
}
//SEG233 print_sbyte_at
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte zeropage(9) b, byte* zeropage(7) at)
print_sbyte_at: {
.label b = 9
.label at = 7
@ -6486,6 +6487,7 @@ print_sbyte_at: {
}
//SEG256 print_char_at
// Print a single char
// print_char_at(byte zeropage($a) ch, byte* zeropage($b) at)
print_char_at: {
.label at = $b
.label ch = $a
@ -6501,6 +6503,7 @@ print_char_at: {
}
//SEG260 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage($2a) at)
print_byte_at: {
.label _0 = $2c
.label _2 = $2d
@ -6563,6 +6566,7 @@ print_byte_at: {
// The rotation matrix is prepared by calling prepare_matrix()
// The passed points must be in the interval [-$3f;$3f].
// Implemented in assembler to utilize seriously fast multiplication
// rotate_matrix(signed byte zeropage($19) x, signed byte zeropage($1a) y, signed byte zeropage($1b) z)
rotate_matrix: {
.label x = $19
.label y = $1a
@ -6721,6 +6725,7 @@ store_matrix: {
// Prepare the 3x3 rotation matrix into rotation_matrix[]
// Angles sx, sy, sz are based on 2*PI=$100
// Method described in C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// calculate_matrix(signed byte zeropage($17) sx, signed byte zeropage($18) sy)
calculate_matrix: {
.label _10 = $38
.label _11 = $39
@ -7572,6 +7577,7 @@ debug_print_init: {
}
//SEG479 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage($10) str, byte* zeropage($12) at)
print_str_at: {
.label at = $12
.label str = $10
@ -9164,6 +9170,7 @@ debug_print: {
}
//SEG233 print_sbyte_at
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte register(X) b, byte* zeropage(6) at)
print_sbyte_at: {
.label at = 6
//SEG234 [115] if((signed byte) print_sbyte_at::b#22<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte_at::@1 -- vbsxx_lt_0_then_la1
@ -9224,6 +9231,7 @@ print_sbyte_at: {
}
//SEG256 print_char_at
// Print a single char
// print_char_at(byte zeropage(8) ch, byte* zeropage(6) at)
print_char_at: {
.label at = 6
.label ch = 8
@ -9239,6 +9247,7 @@ print_char_at: {
}
//SEG260 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage(6) at)
print_byte_at: {
.label at = 6
//SEG261 [128] (byte~) print_byte_at::$0 ← (byte)(signed byte) print_sbyte_at::b#24 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
@ -9290,6 +9299,7 @@ print_byte_at: {
// The rotation matrix is prepared by calling prepare_matrix()
// The passed points must be in the interval [-$3f;$3f].
// Implemented in assembler to utilize seriously fast multiplication
// rotate_matrix(signed byte zeropage(5) x, signed byte register(Y) y, signed byte register(X) z)
rotate_matrix: {
.label x = 5
//SEG279 [137] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsz1
@ -9446,6 +9456,7 @@ store_matrix: {
// Prepare the 3x3 rotation matrix into rotation_matrix[]
// Angles sx, sy, sz are based on 2*PI=$100
// Method described in C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// calculate_matrix(signed byte register(X) sx, signed byte zeropage(3) sy)
calculate_matrix: {
.label sy = 3
.label t1 = 4
@ -10218,6 +10229,7 @@ debug_print_init: {
}
//SEG479 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage(6) str, byte* zeropage(9) at)
print_str_at: {
.label at = 9
.label str = 6
@ -10728,8 +10740,8 @@ Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [338] bne b1 to beq
Fixing long branch [1025] bne b2 to beq
Fixing long branch [1035] bne b1 to beq
Fixing long branch [1030] bne b2 to beq
Fixing long branch [1040] bne b1 to beq
FINAL SYMBOL TABLE
(label) @33
@ -11933,6 +11945,7 @@ debug_print: {
}
//SEG233 print_sbyte_at
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte register(X) b, byte* zeropage(6) at)
print_sbyte_at: {
.label at = 6
//SEG234 [115] if((signed byte) print_sbyte_at::b#22<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte_at::@1 -- vbsxx_lt_0_then_la1
@ -11982,6 +11995,7 @@ print_sbyte_at: {
}
//SEG256 print_char_at
// Print a single char
// print_char_at(byte zeropage(8) ch, byte* zeropage(6) at)
print_char_at: {
.label at = 6
.label ch = 8
@ -11995,6 +12009,7 @@ print_char_at: {
}
//SEG260 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage(6) at)
print_byte_at: {
.label at = 6
//SEG261 [128] (byte~) print_byte_at::$0 ← (byte)(signed byte) print_sbyte_at::b#24 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
@ -12040,6 +12055,7 @@ print_byte_at: {
// The rotation matrix is prepared by calling prepare_matrix()
// The passed points must be in the interval [-$3f;$3f].
// Implemented in assembler to utilize seriously fast multiplication
// rotate_matrix(signed byte zeropage(5) x, signed byte register(Y) y, signed byte register(X) z)
rotate_matrix: {
.label x = 5
//SEG279 [137] *((const signed byte*) xr#0) ← (signed byte) rotate_matrix::x#0 -- _deref_pbsc1=vbsz1
@ -12192,6 +12208,7 @@ store_matrix: {
// Prepare the 3x3 rotation matrix into rotation_matrix[]
// Angles sx, sy, sz are based on 2*PI=$100
// Method described in C= Hacking Magazine Issue 8. http://www.ffd2.com/fridge/chacking/c=hacking8.txt
// calculate_matrix(signed byte register(X) sx, signed byte zeropage(3) sy)
calculate_matrix: {
.label sy = 3
.label t1 = 4
@ -12888,6 +12905,7 @@ debug_print_init: {
}
//SEG479 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage(6) str, byte* zeropage(9) at)
print_str_at: {
.label at = 9
.label str = 6

View File

@ -114,6 +114,7 @@ print_ln: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
b1:
@ -137,6 +138,7 @@ print_str: {
jmp b1
}
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
txa
lsr
@ -154,6 +156,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -193,6 +196,7 @@ perspective: {
rts
}
// Print a signed byte as HEX
// print_sbyte(signed byte register(X) b)
print_sbyte: {
cpx #0
bmi b1

View File

@ -2225,6 +2225,7 @@ print_ln: {
}
//SEG105 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG106 [45] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -2266,6 +2267,7 @@ print_str: {
}
//SEG117 print_byte
// Print a byte as HEX
// print_byte(byte zeropage(6) b)
print_byte: {
.label _0 = $12
.label _2 = $13
@ -2312,6 +2314,7 @@ print_byte: {
}
//SEG133 print_char
// Print a single char
// print_char(byte zeropage(7) ch)
print_char: {
.label ch = 7
//SEG134 [60] *((byte*) print_char_cursor#44) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuz2
@ -2370,6 +2373,7 @@ perspective: {
}
//SEG145 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage($a) b)
print_sbyte: {
.label b = $a
//SEG146 [69] if((signed byte) print_sbyte::b#4<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -3037,6 +3041,7 @@ print_ln: {
}
//SEG105 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG106 [45] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -3078,6 +3083,7 @@ print_str: {
}
//SEG117 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG118 [52] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -3117,6 +3123,7 @@ print_byte: {
}
//SEG133 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG134 [60] *((byte*) print_char_cursor#44) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa
ldy #0
@ -3173,6 +3180,7 @@ perspective: {
}
//SEG145 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte register(X) b)
print_sbyte: {
//SEG146 [69] if((signed byte) print_sbyte::b#4<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsxx_lt_0_then_la1
cpx #0
@ -3997,6 +4005,7 @@ print_ln: {
}
//SEG105 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG106 [45] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -4032,6 +4041,7 @@ print_str: {
}
//SEG117 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG118 [52] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -4065,6 +4075,7 @@ print_byte: {
}
//SEG133 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG134 [60] *((byte*) print_char_cursor#44) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa
ldy #0
@ -4116,6 +4127,7 @@ perspective: {
}
//SEG145 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte register(X) b)
print_sbyte: {
//SEG146 [69] if((signed byte) print_sbyte::b#4<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsxx_lt_0_then_la1
cpx #0

View File

@ -48,6 +48,7 @@ lines: {
rts
}
// Draw a line on the bitmap
// bitmap_line(byte zeropage(5) x0, byte zeropage(8) x1, byte zeropage(6) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 4
.label yd = 3
@ -147,6 +148,7 @@ bitmap_line: {
jsr bitmap_line_xdyi
jmp breturn
}
// bitmap_line_xdyi(byte register(X) x, byte zeropage(6) y, byte zeropage(5) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyi: {
.label _6 = 8
.label y = 6
@ -181,6 +183,7 @@ bitmap_line_xdyi: {
bne b1
rts
}
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 9
.label plotter_x = 9
@ -206,6 +209,7 @@ bitmap_plot: {
sta (_0),y
rts
}
// bitmap_line_ydxi(byte zeropage(7) y, byte register(X) x, byte zeropage(6) y1, byte zeropage(3) yd, byte zeropage(4) xd)
bitmap_line_ydxi: {
.label y = 7
.label y1 = 6
@ -238,6 +242,7 @@ bitmap_line_ydxi: {
bne b1
rts
}
// bitmap_line_xdyd(byte register(X) x, byte zeropage(6) y, byte zeropage(8) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyd: {
.label _6 = 7
.label y = 6
@ -272,6 +277,7 @@ bitmap_line_xdyd: {
bne b1
rts
}
// bitmap_line_ydxd(byte zeropage(7) y, byte register(X) x, byte zeropage(6) y1, byte zeropage(3) yd, byte zeropage(4) xd)
bitmap_line_ydxd: {
.label y = 7
.label y1 = 6

View File

@ -2953,6 +2953,7 @@ lines: {
}
//SEG43 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage($28) x0, byte zeropage($29) x1, byte zeropage($2a) y0, byte zeropage($2b) y1)
bitmap_line: {
.label xd = $2f
.label xd_1 = $2c
@ -3263,6 +3264,7 @@ bitmap_line: {
jmp breturn
}
//SEG169 bitmap_line_xdyi
// bitmap_line_xdyi(byte zeropage(6) x, byte zeropage(7) y, byte zeropage(5) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyi: {
.label _6 = $32
.label x = 6
@ -3343,6 +3345,7 @@ bitmap_line_xdyi: {
rts
}
//SEG197 bitmap_plot
// bitmap_plot(byte zeropage(9) x, byte zeropage($a) y)
bitmap_plot: {
.label _0 = $37
.label _1 = $39
@ -3387,6 +3390,7 @@ bitmap_plot: {
rts
}
//SEG205 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage($f) y, byte zeropage($e) x, byte zeropage($d) y1, byte zeropage($c) yd, byte zeropage($b) xd)
bitmap_line_ydxi: {
.label _6 = $3a
.label y = $f
@ -3467,6 +3471,7 @@ bitmap_line_ydxi: {
rts
}
//SEG233 bitmap_line_xdyd
// bitmap_line_xdyd(byte zeropage($14) x, byte zeropage($15) y, byte zeropage($13) x1, byte zeropage($12) xd, byte zeropage($11) yd)
bitmap_line_xdyd: {
.label _6 = $3b
.label x = $14
@ -3547,6 +3552,7 @@ bitmap_line_xdyd: {
rts
}
//SEG261 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage($1b) y, byte zeropage($1a) x, byte zeropage($19) y1, byte zeropage($18) yd, byte zeropage($17) xd)
bitmap_line_ydxd: {
.label _6 = $3c
.label y = $1b
@ -4377,6 +4383,7 @@ lines: {
}
//SEG43 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage(5) x0, byte zeropage(8) x1, byte zeropage(6) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 4
.label yd = 3
@ -4630,6 +4637,7 @@ bitmap_line: {
jmp breturn
}
//SEG169 bitmap_line_xdyi
// bitmap_line_xdyi(byte register(X) x, byte zeropage(6) y, byte zeropage(5) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyi: {
.label _6 = 8
.label y = 6
@ -4705,6 +4713,7 @@ bitmap_line_xdyi: {
rts
}
//SEG197 bitmap_plot
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 9
.label plotter_x = 9
@ -4741,6 +4750,7 @@ bitmap_plot: {
rts
}
//SEG205 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage(7) y, byte register(X) x, byte zeropage(6) y1, byte zeropage(3) yd, byte zeropage(4) xd)
bitmap_line_ydxi: {
.label y = 7
.label y1 = 6
@ -4814,6 +4824,7 @@ bitmap_line_ydxi: {
rts
}
//SEG233 bitmap_line_xdyd
// bitmap_line_xdyd(byte register(X) x, byte zeropage(6) y, byte zeropage(8) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyd: {
.label _6 = 7
.label y = 6
@ -4889,6 +4900,7 @@ bitmap_line_xdyd: {
rts
}
//SEG261 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage(7) y, byte register(X) x, byte zeropage(6) y1, byte zeropage(3) yd, byte zeropage(4) xd)
bitmap_line_ydxd: {
.label y = 7
.label y1 = 6
@ -5896,6 +5908,7 @@ lines: {
}
//SEG43 bitmap_line
// Draw a line on the bitmap
// bitmap_line(byte zeropage(5) x0, byte zeropage(8) x1, byte zeropage(6) y0, byte register(Y) y1)
bitmap_line: {
.label xd = 4
.label yd = 3
@ -6121,6 +6134,7 @@ bitmap_line: {
jmp breturn
}
//SEG169 bitmap_line_xdyi
// bitmap_line_xdyi(byte register(X) x, byte zeropage(6) y, byte zeropage(5) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyi: {
.label _6 = 8
.label y = 6
@ -6183,6 +6197,7 @@ bitmap_line_xdyi: {
rts
}
//SEG197 bitmap_plot
// bitmap_plot(byte register(X) x, byte register(Y) y)
bitmap_plot: {
.label _0 = 9
.label plotter_x = 9
@ -6216,6 +6231,7 @@ bitmap_plot: {
rts
}
//SEG205 bitmap_line_ydxi
// bitmap_line_ydxi(byte zeropage(7) y, byte register(X) x, byte zeropage(6) y1, byte zeropage(3) yd, byte zeropage(4) xd)
bitmap_line_ydxi: {
.label y = 7
.label y1 = 6
@ -6276,6 +6292,7 @@ bitmap_line_ydxi: {
rts
}
//SEG233 bitmap_line_xdyd
// bitmap_line_xdyd(byte register(X) x, byte zeropage(6) y, byte zeropage(8) x1, byte zeropage(4) xd, byte zeropage(3) yd)
bitmap_line_xdyd: {
.label _6 = 7
.label y = 6
@ -6338,6 +6355,7 @@ bitmap_line_xdyd: {
rts
}
//SEG261 bitmap_line_ydxd
// bitmap_line_ydxd(byte zeropage(7) y, byte register(X) x, byte zeropage(6) y1, byte zeropage(3) yd, byte zeropage(4) xd)
bitmap_line_ydxd: {
.label y = 7
.label y1 = 6

View File

@ -214,6 +214,7 @@ main: {
str3: .text "f7@"
}
// Render 8x8 char (ch) as pixels on char canvas #pos
// plot_chargen(byte register(Y) pos, byte register(A) ch, byte register(X) shift)
plot_chargen: {
.label _0 = 2
.label _1 = 2
@ -305,6 +306,7 @@ plot_chargen: {
rts
}
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a)
mul8u: {
.const b = $a
.label mb = $b
@ -345,6 +347,7 @@ mul8u: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(X) key)
keyboard_key_pressed: {
txa
and #7
@ -363,6 +366,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
lda keyboard_matrix_row_bitmask,x
sta CIA1_PORT_A
@ -374,11 +378,13 @@ keyboard_matrix_read: {
// ch is the character to get the key code for ($00-$3f)
// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled.
// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) .
// keyboard_get_keycode(byte register(X) ch)
keyboard_get_keycode: {
lda keyboard_char_keycodes,x
rts
}
// Print a string at a specific screen position
// print_str_at(byte* zeropage(2) str, byte* zeropage(9) at)
print_str_at: {
.label at = 9
.label str = 2

View File

@ -3151,6 +3151,7 @@ main: {
}
//SEG169 plot_chargen
// Render 8x8 char (ch) as pixels on char canvas #pos
// plot_chargen(byte zeropage($b) pos, byte zeropage(9) ch, byte zeropage($a) shift)
plot_chargen: {
.label _0 = $2c
.label _1 = $2e
@ -3355,6 +3356,7 @@ plot_chargen: {
}
//SEG228 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte zeropage($14) a)
mul8u: {
.const b = $a
.label _1 = $35
@ -3432,6 +3434,7 @@ mul8u: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte zeropage($19) key)
keyboard_key_pressed: {
.label _2 = $3a
.label colidx = $36
@ -3485,6 +3488,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte zeropage($38) rowid)
keyboard_matrix_read: {
.label return = $3c
.label rowid = $38
@ -3508,6 +3512,7 @@ keyboard_matrix_read: {
// ch is the character to get the key code for ($00-$3f)
// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled.
// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) .
// keyboard_get_keycode(byte zeropage($28) ch)
keyboard_get_keycode: {
.label return = $3d
.label ch = $28
@ -3524,6 +3529,7 @@ keyboard_get_keycode: {
}
//SEG271 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage($1a) str, byte* zeropage($1c) at)
print_str_at: {
.label at = $1c
.label str = $1a
@ -4260,6 +4266,7 @@ main: {
}
//SEG169 plot_chargen
// Render 8x8 char (ch) as pixels on char canvas #pos
// plot_chargen(byte register(Y) pos, byte register(A) ch, byte register(X) shift)
plot_chargen: {
.label _0 = 2
.label _1 = 2
@ -4437,6 +4444,7 @@ plot_chargen: {
}
//SEG228 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a)
mul8u: {
.const b = $a
.label mb = $b
@ -4511,6 +4519,7 @@ mul8u: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(X) key)
keyboard_key_pressed: {
//SEG252 [114] (byte) keyboard_key_pressed::colidx#0 ← (byte) keyboard_key_pressed::key#6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuyy=vbuxx_band_vbuc1
txa
@ -4544,6 +4553,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
//SEG263 [122] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
@ -4562,6 +4572,7 @@ keyboard_matrix_read: {
// ch is the character to get the key code for ($00-$3f)
// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled.
// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) .
// keyboard_get_keycode(byte register(X) ch)
keyboard_get_keycode: {
//SEG268 [125] (byte) keyboard_get_keycode::return#0 ← *((const byte[]) keyboard_char_keycodes#0 + (byte) keyboard_get_keycode::ch#0) -- vbuaa=pbuc1_derefidx_vbuxx
lda keyboard_char_keycodes,x
@ -4573,6 +4584,7 @@ keyboard_get_keycode: {
}
//SEG271 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage(2) str, byte* zeropage(9) at)
print_str_at: {
.label at = 9
.label str = 2
@ -5642,6 +5654,7 @@ main: {
}
//SEG169 plot_chargen
// Render 8x8 char (ch) as pixels on char canvas #pos
// plot_chargen(byte register(Y) pos, byte register(A) ch, byte register(X) shift)
plot_chargen: {
.label _0 = 2
.label _1 = 2
@ -5792,6 +5805,7 @@ plot_chargen: {
}
//SEG228 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a)
mul8u: {
.const b = $a
.label mb = $b
@ -5855,6 +5869,7 @@ mul8u: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(X) key)
keyboard_key_pressed: {
//SEG252 [114] (byte) keyboard_key_pressed::colidx#0 ← (byte) keyboard_key_pressed::key#6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuyy=vbuxx_band_vbuc1
txa
@ -5884,6 +5899,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
//SEG263 [122] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
@ -5900,6 +5916,7 @@ keyboard_matrix_read: {
// ch is the character to get the key code for ($00-$3f)
// Returns the key code corresponding to the passed character. Only characters with a non-shifted key are handled.
// If there is no non-shifted key representing the char $3f is returned (representing RUN/STOP) .
// keyboard_get_keycode(byte register(X) ch)
keyboard_get_keycode: {
//SEG268 [125] (byte) keyboard_get_keycode::return#0 ← *((const byte[]) keyboard_char_keycodes#0 + (byte) keyboard_get_keycode::ch#0) -- vbuaa=pbuc1_derefidx_vbuxx
lda keyboard_char_keycodes,x
@ -5909,6 +5926,7 @@ keyboard_get_keycode: {
}
//SEG271 print_str_at
// Print a string at a specific screen position
// print_str_at(byte* zeropage(2) str, byte* zeropage(9) at)
print_str_at: {
.label at = 9
.label str = 2

View File

@ -108,6 +108,7 @@ main: {
rts
}
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte zeropage($a) b, byte* zeropage(8) at)
print_sbyte_at: {
.label b = $a
.label at = 8
@ -135,6 +136,7 @@ print_sbyte_at: {
jmp b2
}
// Print a single char
// print_char_at(byte zeropage($b) ch, byte* zeropage(8) at)
print_char_at: {
.label at = 8
.label ch = $b
@ -144,6 +146,7 @@ print_char_at: {
rts
}
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage(8) at)
print_byte_at: {
.label at = 8
lda print_sbyte_at.b
@ -167,6 +170,7 @@ print_byte_at: {
jsr print_char_at
rts
}
// fmul8(signed byte register(A) a, signed byte register(Y) b)
fmul8: {
sta ap
tya

View File

@ -1535,6 +1535,7 @@ main: {
}
//SEG74 print_sbyte_at
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte zeropage($d) b, byte* zeropage($b) at)
print_sbyte_at: {
.label b = $d
.label at = $b
@ -1607,6 +1608,7 @@ print_sbyte_at: {
}
//SEG97 print_char_at
// Print a single char
// print_char_at(byte zeropage($e) ch, byte* zeropage($f) at)
print_char_at: {
.label at = $f
.label ch = $e
@ -1622,6 +1624,7 @@ print_char_at: {
}
//SEG101 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage($1b) at)
print_byte_at: {
.label _0 = $1d
.label _2 = $1e
@ -1680,6 +1683,7 @@ print_byte_at: {
rts
}
//SEG119 fmul8
// fmul8(signed byte zeropage($17) a, signed byte zeropage($18) b)
fmul8: {
.label a = $17
.label b = $18
@ -2210,6 +2214,7 @@ main: {
}
//SEG74 print_sbyte_at
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte zeropage($a) b, byte* zeropage(8) at)
print_sbyte_at: {
.label b = $a
.label at = 8
@ -2271,6 +2276,7 @@ print_sbyte_at: {
}
//SEG97 print_char_at
// Print a single char
// print_char_at(byte zeropage($b) ch, byte* zeropage(8) at)
print_char_at: {
.label at = 8
.label ch = $b
@ -2286,6 +2292,7 @@ print_char_at: {
}
//SEG101 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage(8) at)
print_byte_at: {
.label at = 8
//SEG102 [49] (byte~) print_byte_at::$0 ← (byte)(signed byte) print_sbyte_at::b#6 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuz1_ror_4
@ -2333,6 +2340,7 @@ print_byte_at: {
rts
}
//SEG119 fmul8
// fmul8(signed byte register(A) a, signed byte register(Y) b)
fmul8: {
//SEG120 [58] *((const signed byte*) ap#0) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsaa
sta ap
@ -2916,6 +2924,7 @@ main: {
}
//SEG74 print_sbyte_at
// Print a signed byte as hex at a specific screen position
// print_sbyte_at(signed byte zeropage($a) b, byte* zeropage(8) at)
print_sbyte_at: {
.label b = $a
.label at = 8
@ -2966,6 +2975,7 @@ print_sbyte_at: {
}
//SEG97 print_char_at
// Print a single char
// print_char_at(byte zeropage($b) ch, byte* zeropage(8) at)
print_char_at: {
.label at = 8
.label ch = $b
@ -2979,6 +2989,7 @@ print_char_at: {
}
//SEG101 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte* zeropage(8) at)
print_byte_at: {
.label at = 8
//SEG102 [49] (byte~) print_byte_at::$0 ← (byte)(signed byte) print_sbyte_at::b#6 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuz1_ror_4
@ -3020,6 +3031,7 @@ print_byte_at: {
rts
}
//SEG119 fmul8
// fmul8(signed byte register(A) a, signed byte register(Y) b)
fmul8: {
//SEG120 [58] *((const signed byte*) ap#0) ← (signed byte) fmul8::a#0 -- _deref_pbsc1=vbsaa
sta ap

View File

@ -34,6 +34,7 @@ print_ln: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
lda #<$400

View File

@ -407,6 +407,7 @@ print_ln: {
}
//SEG29 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG30 [15] phi from print_str to print_str::@1 [phi:print_str->print_str::@1]
@ -569,6 +570,7 @@ print_ln: {
}
//SEG29 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG30 [15] phi from print_str to print_str::@1 [phi:print_str->print_str::@1]
@ -760,6 +762,7 @@ print_ln: {
}
//SEG29 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG30 [15] phi from print_str to print_str::@1 [phi:print_str->print_str::@1]

View File

@ -150,6 +150,7 @@ anim: {
}
// Calculate fast multiply with a prepared unsigned byte to a word result
// The prepared number is set by calling mulf8s_prepare(byte a)
// mulf8s_prepared(signed byte register(Y) b)
mulf8s_prepared: {
.label memA = $fd
.label m = 5
@ -199,6 +200,7 @@ mulf8u_prepared: {
rts
}
// Prepare for fast multiply with an unsigned byte to a word result
// mulf8u_prepare(byte register(A) a)
mulf8u_prepare: {
.label memA = $fd
sta memA

View File

@ -2658,6 +2658,7 @@ anim: {
//SEG109 mulf8s_prepared
// Calculate fast multiply with a prepared unsigned byte to a word result
// The prepared number is set by calling mulf8s_prepare(byte a)
// mulf8s_prepared(signed byte zeropage(5) b)
mulf8s_prepared: {
.label memA = $fd
.label _4 = $41
@ -2786,6 +2787,7 @@ mulf8u_prepared: {
}
//SEG140 mulf8u_prepare
// Prepare for fast multiply with an unsigned byte to a word result
// mulf8u_prepare(byte zeropage(8) a)
mulf8u_prepare: {
.label memA = $fd
.label a = 8
@ -3682,6 +3684,7 @@ anim: {
//SEG109 mulf8s_prepared
// Calculate fast multiply with a prepared unsigned byte to a word result
// The prepared number is set by calling mulf8s_prepare(byte a)
// mulf8s_prepared(signed byte register(Y) b)
mulf8s_prepared: {
.label memA = $fd
.label m = 5
@ -3780,6 +3783,7 @@ mulf8u_prepared: {
}
//SEG140 mulf8u_prepare
// Prepare for fast multiply with an unsigned byte to a word result
// mulf8u_prepare(byte register(A) a)
mulf8u_prepare: {
.label memA = $fd
//SEG141 [84] *((const byte*) mulf8u_prepare::memA#0) ← (byte) mulf8u_prepare::a#2 -- _deref_pbuc1=vbuaa
@ -4786,6 +4790,7 @@ anim: {
//SEG109 mulf8s_prepared
// Calculate fast multiply with a prepared unsigned byte to a word result
// The prepared number is set by calling mulf8s_prepare(byte a)
// mulf8s_prepared(signed byte register(Y) b)
mulf8s_prepared: {
.label memA = $fd
.label m = 5
@ -4866,6 +4871,7 @@ mulf8u_prepared: {
}
//SEG140 mulf8u_prepare
// Prepare for fast multiply with an unsigned byte to a word result
// mulf8u_prepare(byte register(A) a)
mulf8u_prepare: {
.label memA = $fd
//SEG141 [84] *((const byte*) mulf8u_prepare::memA#0) ← (byte) mulf8u_prepare::a#2 -- _deref_pbuc1=vbuaa

View File

@ -111,6 +111,7 @@ loop: {
dec BORDERCOL
jmp b1
}
// render_logo(signed word zeropage(8) xpos)
render_logo: {
.label _3 = $e
.label xpos = 8
@ -238,6 +239,7 @@ render_logo: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage(2) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -328,6 +330,7 @@ sin16s_gen2: {
}
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($17) a)
mul16s: {
.label _5 = 2
.label _6 = $e
@ -369,6 +372,7 @@ mul16s: {
rts
}
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($10) a, word zeropage($e) b)
mul16u: {
.label mb = $12
.label a = $10
@ -423,6 +427,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($a) x)
sin16s: {
.label _6 = $a
.label x = $a
@ -598,6 +603,7 @@ sin16s: {
}
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($19) v1, word zeropage($e) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $a
.label _1 = $a
@ -664,6 +670,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(8) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 8
@ -714,6 +721,7 @@ divr16u: {
rts
}
// Fill some memory with a value
// fill(byte register(X) val)
fill: {
.label end = 8
.label addr = 2

View File

@ -4346,6 +4346,7 @@ loop: {
jmp b7
}
//SEG75 render_logo
// render_logo(signed word zeropage($3b) xpos)
render_logo: {
.label _0 = $3d
.label _1 = $3e
@ -4741,6 +4742,7 @@ render_logo: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage($d) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -4919,6 +4921,7 @@ sin16s_gen2: {
//SEG217 mul16s
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($5a) a)
mul16s: {
.label _5 = $6c
.label _6 = $6e
@ -5019,6 +5022,7 @@ mul16s: {
}
//SEG239 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($17) a, word zeropage($15) b)
mul16u: {
.label _1 = $76
.label mb = $1d
@ -5113,6 +5117,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($22) x)
sin16s: {
.label _6 = $77
.label x = $22
@ -5470,6 +5475,7 @@ sin16s: {
//SEG344 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($28) v1, word zeropage($2a) v2, byte zeropage($2c) select)
mulu16_sel: {
.label _0 = $9b
.label _1 = $9f
@ -5632,6 +5638,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($2f) dividend, word zeropage($2d) rem)
divr16u: {
.label _1 = $b1
.label _2 = $b2
@ -5753,6 +5760,7 @@ divr16u: {
}
//SEG414 fill
// Fill some memory with a value
// fill(byte zeropage($34) val)
fill: {
.label end = $b5
.label addr = $35
@ -6518,6 +6526,7 @@ loop: {
jmp b7
}
//SEG75 render_logo
// render_logo(signed word zeropage(8) xpos)
render_logo: {
.label _3 = $e
.label xpos = 8
@ -6825,6 +6834,7 @@ render_logo: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage(2) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -6963,6 +6973,7 @@ sin16s_gen2: {
//SEG217 mul16s
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($17) a)
mul16s: {
.label _5 = 2
.label _6 = $e
@ -7038,6 +7049,7 @@ mul16s: {
}
//SEG239 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($10) a, word zeropage($e) b)
mul16u: {
.label mb = $12
.label a = $10
@ -7128,6 +7140,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($a) x)
sin16s: {
.label _6 = $a
.label x = $a
@ -7417,6 +7430,7 @@ sin16s: {
//SEG344 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($19) v1, word zeropage($e) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $a
.label _1 = $a
@ -7530,6 +7544,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(8) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 8
@ -7636,6 +7651,7 @@ divr16u: {
}
//SEG414 fill
// Fill some memory with a value
// fill(byte register(X) val)
fill: {
.label end = 8
.label addr = 2
@ -8630,6 +8646,7 @@ loop: {
//SEG74 [35] phi (word) xsin_idx#19 = (word) xsin_idx#3 [phi:loop::@16->loop::@7#0] -- register_copy
}
//SEG75 render_logo
// render_logo(signed word zeropage(8) xpos)
render_logo: {
.label _3 = $e
.label xpos = 8
@ -8866,6 +8883,7 @@ render_logo: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage(2) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -8989,6 +9007,7 @@ sin16s_gen2: {
//SEG217 mul16s
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($17) a)
mul16s: {
.label _5 = 2
.label _6 = $e
@ -9052,6 +9071,7 @@ mul16s: {
}
//SEG239 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($10) a, word zeropage($e) b)
mul16u: {
.label mb = $12
.label a = $10
@ -9130,6 +9150,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($a) x)
sin16s: {
.label _6 = $a
.label x = $a
@ -9386,6 +9407,7 @@ sin16s: {
//SEG344 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($19) v1, word zeropage($e) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $a
.label _1 = $a
@ -9485,6 +9507,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(8) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 8
@ -9572,6 +9595,7 @@ divr16u: {
}
//SEG414 fill
// Fill some memory with a value
// fill(byte register(X) val)
fill: {
.label end = 8
.label addr = 2

View File

@ -63,6 +63,7 @@ main: {
jmp b3
}
// Fill some memory with a value
// fill(word zeropage(2) size, byte register(X) val)
fill: {
.label end = 2
.label addr = 4

View File

@ -1002,6 +1002,7 @@ main: {
}
//SEG44 fill
// Fill some memory with a value
// fill(word zeropage(3) size, byte zeropage(5) val)
fill: {
.label end = 8
.label addr = 6
@ -1228,6 +1229,7 @@ main: {
}
//SEG44 fill
// Fill some memory with a value
// fill(word zeropage(2) size, byte register(X) val)
fill: {
.label end = 2
.label addr = 4
@ -1577,6 +1579,7 @@ main: {
}
//SEG44 fill
// Fill some memory with a value
// fill(word zeropage(2) size, byte register(X) val)
fill: {
.label end = 2
.label addr = 4

View File

@ -164,6 +164,7 @@ render_sine: {
rts
}
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(4) x, byte register(X) y)
bitmap_plot: {
.label _1 = $10
.label plotter = 6
@ -194,6 +195,7 @@ bitmap_plot: {
sta (plotter),y
rts
}
// wrap_y(signed word zeropage(6) y)
wrap_y: {
.label y = 6
b1:
@ -232,6 +234,7 @@ wrap_y: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage(2) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -322,6 +325,7 @@ sin16s_gen2: {
}
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($17) a)
mul16s: {
.label _5 = 2
.label _6 = 6
@ -363,6 +367,7 @@ mul16s: {
rts
}
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($10) a, word zeropage(6) b)
mul16u: {
.label mb = $12
.label a = $10
@ -417,6 +422,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($c) x)
sin16s: {
.label _6 = $c
.label x = $c
@ -592,6 +598,7 @@ sin16s: {
}
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($19) v1, word zeropage(6) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $c
.label _1 = $c
@ -658,6 +665,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4

View File

@ -4084,6 +4084,7 @@ render_sine: {
}
//SEG102 bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(7) x, byte zeropage(6) y)
bitmap_plot: {
.label _1 = $53
.label _2 = $57
@ -4129,6 +4130,7 @@ bitmap_plot: {
rts
}
//SEG110 wrap_y
// wrap_y(signed word zeropage(9) y)
wrap_y: {
.label y = 9
.label return = $47
@ -4198,6 +4200,7 @@ wrap_y: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage($f) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -4376,6 +4379,7 @@ sin16s_gen2: {
//SEG160 mul16s
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($63) a)
mul16s: {
.label _5 = $75
.label _6 = $77
@ -4476,6 +4480,7 @@ mul16s: {
}
//SEG182 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($19) a, word zeropage($17) b)
mul16u: {
.label _1 = $7f
.label mb = $1f
@ -4570,6 +4575,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($24) x)
sin16s: {
.label _6 = $80
.label x = $24
@ -4927,6 +4933,7 @@ sin16s: {
//SEG287 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($2a) v1, word zeropage($2c) v2, byte zeropage($2e) select)
mulu16_sel: {
.label _0 = $a4
.label _1 = $a8
@ -5089,6 +5096,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($31) dividend, word zeropage($2f) rem)
divr16u: {
.label _1 = $ba
.label _2 = $bb
@ -6258,6 +6266,7 @@ render_sine: {
}
//SEG102 bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(4) x, byte register(X) y)
bitmap_plot: {
.label _1 = $10
.label plotter = 6
@ -6299,6 +6308,7 @@ bitmap_plot: {
rts
}
//SEG110 wrap_y
// wrap_y(signed word zeropage(6) y)
wrap_y: {
.label y = 6
//SEG111 [62] phi from wrap_y wrap_y::@2 to wrap_y::@1 [phi:wrap_y/wrap_y::@2->wrap_y::@1]
@ -6364,6 +6374,7 @@ wrap_y: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage(2) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -6502,6 +6513,7 @@ sin16s_gen2: {
//SEG160 mul16s
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($17) a)
mul16s: {
.label _5 = 2
.label _6 = 6
@ -6577,6 +6589,7 @@ mul16s: {
}
//SEG182 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($10) a, word zeropage(6) b)
mul16u: {
.label mb = $12
.label a = $10
@ -6667,6 +6680,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($c) x)
sin16s: {
.label _6 = $c
.label x = $c
@ -6956,6 +6970,7 @@ sin16s: {
//SEG287 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($19) v1, word zeropage(6) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $c
.label _1 = $c
@ -7069,6 +7084,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4
@ -8472,6 +8488,7 @@ render_sine: {
}
//SEG102 bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(4) x, byte register(X) y)
bitmap_plot: {
.label _1 = $10
.label plotter = 6
@ -8510,6 +8527,7 @@ bitmap_plot: {
rts
}
//SEG110 wrap_y
// wrap_y(signed word zeropage(6) y)
wrap_y: {
.label y = 6
//SEG111 [62] phi from wrap_y wrap_y::@2 to wrap_y::@1 [phi:wrap_y/wrap_y::@2->wrap_y::@1]
@ -8565,6 +8583,7 @@ wrap_y: {
// Generate signed word sinus table - with values in the range min-max.
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen2(signed word* zeropage(2) sintab)
sin16s_gen2: {
.const min = -$140
.const max = $140
@ -8688,6 +8707,7 @@ sin16s_gen2: {
//SEG160 mul16s
// Multiply of two signed words to a signed double word
// Fixes offsets introduced by using unsigned multiplication
// mul16s(signed word zeropage($17) a)
mul16s: {
.label _5 = 2
.label _6 = 6
@ -8751,6 +8771,7 @@ mul16s: {
}
//SEG182 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($10) a, word zeropage(6) b)
mul16u: {
.label mb = $12
.label a = $10
@ -8829,6 +8850,7 @@ mul16u: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($c) x)
sin16s: {
.label _6 = $c
.label x = $c
@ -9085,6 +9107,7 @@ sin16s: {
//SEG287 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($19) v1, word zeropage(6) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $c
.label _1 = $c
@ -9184,6 +9207,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4

View File

@ -194,6 +194,7 @@ clear_screen: {
// - length is the length of the sine table
// - min is the minimum value of the generated sinus
// - max is the maximum value of the generated sinus
// gen_sintab(byte* zeropage(8) sintab, byte zeropage(3) length, byte zeropage(2) min, byte register(X) max)
gen_sintab: {
// amplitude/2
.label f_2pi = $e2e5
@ -359,6 +360,7 @@ addMEMtoFAC: {
rts
}
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage($c) mem)
prepareMEM: {
.label mem = $c
lda mem
@ -370,6 +372,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage($c) mem)
mulFACbyMEM: {
.label mem = $c
jsr prepareMEM
@ -388,6 +391,7 @@ sinFAC: {
// FAC = MEM/FAC
// Set FAC to MEM (float saved in memory) divided by FAC (float accumulator)
// Reads 5 bytes from memory
// divMEMbyFAC(byte* zeropage($c) mem)
divMEMbyFAC: {
.label mem = $c
jsr prepareMEM
@ -398,6 +402,7 @@ divMEMbyFAC: {
}
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage($c) w)
setFAC: {
.label w = $c
jsr prepareMEM
@ -410,6 +415,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage($c) mem)
setMEMtoFAC: {
.label mem = $c
jsr prepareMEM
@ -431,6 +437,7 @@ setARGtoFAC: {
rts
}
// Initialize the PETSCII progress bar
// progress_init(byte* zeropage($a) line)
progress_init: {
.label line = $a
rts
@ -469,6 +476,7 @@ gen_sprites: {
// Generate a sprite from a C64 CHARGEN character (by making each pixel 3x3 pixels large)
// - c is the character to generate
// - sprite is a pointer to the position of the sprite to generate
// gen_chargen_sprite(byte register(Y) ch, byte* zeropage($a) sprite)
gen_chargen_sprite: {
.label _0 = $c
.label _1 = $c

View File

@ -3960,6 +3960,7 @@ clear_screen: {
// - length is the length of the sine table
// - min is the minimum value of the generated sinus
// - max is the maximum value of the generated sinus
// gen_sintab(byte* zeropage($f) sintab, byte zeropage($e) length, byte zeropage($d) min, byte zeropage($c) max)
gen_sintab: {
// amplitude/2
.label f_2pi = $e2e5
@ -4371,6 +4372,7 @@ addMEMtoFAC: {
}
//SEG290 prepareMEM
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage($15) mem)
prepareMEM: {
.label _0 = $3c
.label _1 = $3d
@ -4397,6 +4399,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage($17) mem)
mulFACbyMEM: {
.label mem = $17
//SEG298 [143] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2 -- pbuz1=pbuz2
@ -4439,6 +4442,7 @@ sinFAC: {
// FAC = MEM/FAC
// Set FAC to MEM (float saved in memory) divided by FAC (float accumulator)
// Reads 5 bytes from memory
// divMEMbyFAC(byte* zeropage($19) mem)
divMEMbyFAC: {
.label mem = $19
//SEG311 [150] (byte*) prepareMEM::mem#3 ← (byte*) divMEMbyFAC::mem#2 -- pbuz1=pbuz2
@ -4467,6 +4471,7 @@ divMEMbyFAC: {
//SEG319 setFAC
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage($1b) w)
setFAC: {
.label w = $1b
//SEG320 [155] (byte*~) prepareMEM::mem#8 ← (byte*)(word) setFAC::w#5 -- pbuz1=pbuz2
@ -4497,6 +4502,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage($1d) mem)
setMEMtoFAC: {
.label mem = $1d
//SEG329 [160] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#5 -- pbuz1=pbuz2
@ -4548,6 +4554,7 @@ setARGtoFAC: {
}
//SEG345 progress_init
// Initialize the PETSCII progress bar
// progress_init(byte* zeropage($13) line)
progress_init: {
.label line = $13
jmp breturn
@ -4617,6 +4624,7 @@ gen_sprites: {
// Generate a sprite from a C64 CHARGEN character (by making each pixel 3x3 pixels large)
// - c is the character to generate
// - sprite is a pointer to the position of the sprite to generate
// gen_chargen_sprite(byte zeropage($3e) ch, byte* zeropage($29) sprite)
gen_chargen_sprite: {
.label _0 = $3f
.label _1 = $41
@ -5724,6 +5732,7 @@ clear_screen: {
// - length is the length of the sine table
// - min is the minimum value of the generated sinus
// - max is the maximum value of the generated sinus
// gen_sintab(byte* zeropage(8) sintab, byte zeropage(3) length, byte zeropage(2) min, byte register(X) max)
gen_sintab: {
// amplitude/2
.label f_2pi = $e2e5
@ -6122,6 +6131,7 @@ addMEMtoFAC: {
}
//SEG290 prepareMEM
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage($c) mem)
prepareMEM: {
.label mem = $c
//SEG291 [137] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 -- vbuaa=_lo_pbuz1
@ -6142,6 +6152,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage($c) mem)
mulFACbyMEM: {
.label mem = $c
//SEG298 [143] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2
@ -6180,6 +6191,7 @@ sinFAC: {
// FAC = MEM/FAC
// Set FAC to MEM (float saved in memory) divided by FAC (float accumulator)
// Reads 5 bytes from memory
// divMEMbyFAC(byte* zeropage($c) mem)
divMEMbyFAC: {
.label mem = $c
//SEG311 [150] (byte*) prepareMEM::mem#3 ← (byte*) divMEMbyFAC::mem#2
@ -6204,6 +6216,7 @@ divMEMbyFAC: {
//SEG319 setFAC
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage($c) w)
setFAC: {
.label w = $c
//SEG320 [155] (byte*~) prepareMEM::mem#8 ← (byte*)(word) setFAC::w#5
@ -6230,6 +6243,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage($c) mem)
setMEMtoFAC: {
.label mem = $c
//SEG329 [160] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#5
@ -6277,6 +6291,7 @@ setARGtoFAC: {
}
//SEG345 progress_init
// Initialize the PETSCII progress bar
// progress_init(byte* zeropage($a) line)
progress_init: {
.label line = $a
jmp breturn
@ -6345,6 +6360,7 @@ gen_sprites: {
// Generate a sprite from a C64 CHARGEN character (by making each pixel 3x3 pixels large)
// - c is the character to generate
// - sprite is a pointer to the position of the sprite to generate
// gen_chargen_sprite(byte register(Y) ch, byte* zeropage($a) sprite)
gen_chargen_sprite: {
.label _0 = $c
.label _1 = $c
@ -7712,6 +7728,7 @@ clear_screen: {
// - length is the length of the sine table
// - min is the minimum value of the generated sinus
// - max is the maximum value of the generated sinus
// gen_sintab(byte* zeropage(8) sintab, byte zeropage(3) length, byte zeropage(2) min, byte register(X) max)
gen_sintab: {
// amplitude/2
.label f_2pi = $e2e5
@ -8016,6 +8033,7 @@ addMEMtoFAC: {
}
//SEG290 prepareMEM
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage($c) mem)
prepareMEM: {
.label mem = $c
//SEG291 [137] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 -- vbuaa=_lo_pbuz1
@ -8034,6 +8052,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage($c) mem)
mulFACbyMEM: {
.label mem = $c
//SEG298 [143] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2
@ -8065,6 +8084,7 @@ sinFAC: {
// FAC = MEM/FAC
// Set FAC to MEM (float saved in memory) divided by FAC (float accumulator)
// Reads 5 bytes from memory
// divMEMbyFAC(byte* zeropage($c) mem)
divMEMbyFAC: {
.label mem = $c
//SEG311 [150] (byte*) prepareMEM::mem#3 ← (byte*) divMEMbyFAC::mem#2
@ -8084,6 +8104,7 @@ divMEMbyFAC: {
//SEG319 setFAC
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage($c) w)
setFAC: {
.label w = $c
//SEG320 [155] (byte*~) prepareMEM::mem#8 ← (byte*)(word) setFAC::w#5
@ -8105,6 +8126,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage($c) mem)
setMEMtoFAC: {
.label mem = $c
//SEG329 [160] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#5
@ -8143,6 +8165,7 @@ setARGtoFAC: {
}
//SEG345 progress_init
// Initialize the PETSCII progress bar
// progress_init(byte* zeropage($a) line)
progress_init: {
.label line = $a
//SEG346 progress_init::@return
@ -8201,6 +8224,7 @@ gen_sprites: {
// Generate a sprite from a C64 CHARGEN character (by making each pixel 3x3 pixels large)
// - c is the character to generate
// - sprite is a pointer to the position of the sprite to generate
// gen_chargen_sprite(byte register(Y) ch, byte* zeropage($a) sprite)
gen_chargen_sprite: {
.label _0 = $c
.label _1 = $c

View File

@ -7,6 +7,7 @@ main: {
jsr fillscreen
rts
}
// fillscreen(byte register(A) c)
fillscreen: {
.label SCREEN2 = SCREEN+$100
.label SCREEN3 = SCREEN+$200

View File

@ -239,6 +239,7 @@ main: {
rts
}
//SEG16 fillscreen
// fillscreen(byte zeropage(4) c)
fillscreen: {
.label SCREEN2 = SCREEN+$100
.label SCREEN3 = SCREEN+$200
@ -338,6 +339,7 @@ main: {
rts
}
//SEG16 fillscreen
// fillscreen(byte register(A) c)
fillscreen: {
.label SCREEN2 = SCREEN+$100
.label SCREEN3 = SCREEN+$200
@ -459,6 +461,7 @@ main: {
rts
}
//SEG16 fillscreen
// fillscreen(byte register(A) c)
fillscreen: {
.label SCREEN2 = SCREEN+$100
.label SCREEN3 = SCREEN+$200

View File

@ -25,6 +25,7 @@ main: {
sta screen+1
rts
}
// fct(byte register(X) x, byte* zeropage(2) z)
fct: {
.label z = 2
ldy #2

View File

@ -331,6 +331,7 @@ main: {
rts
}
//SEG30 fct
// fct(byte register(X) x, byte* zeropage(2) z)
fct: {
.label return = 4
.label return_1 = 6
@ -444,6 +445,7 @@ main: {
rts
}
//SEG30 fct
// fct(byte register(X) x, byte* zeropage(2) z)
fct: {
.label z = 2
//SEG31 [16] (byte) fct::return#2 ← (byte) fct::x#2 & *((byte*) fct::z#2 + (byte/signed byte/word/signed word/dword/signed dword) 2) -- vbuaa=vbuxx_band_pbuz1_derefidx_vbuc1
@ -581,6 +583,7 @@ main: {
rts
}
//SEG30 fct
// fct(byte register(X) x, byte* zeropage(2) z)
fct: {
.label z = 2
//SEG31 [16] (byte) fct::return#2 ← (byte) fct::x#2 & *((byte*) fct::z#2 + (byte/signed byte/word/signed word/dword/signed dword) 2) -- vbuaa=vbuxx_band_pbuz1_derefidx_vbuc1

View File

@ -16,6 +16,7 @@ main: {
rts
hello: .text "hello world!@"
}
// print2(byte* zeropage(2) at)
print2: {
.label at = 2
ldy #0

View File

@ -278,6 +278,7 @@ main: {
hello: .text "hello world!@"
}
//SEG21 print2
// print2(byte* zeropage(2) at)
print2: {
.label j = 5
.label i = 4
@ -399,6 +400,7 @@ main: {
hello: .text "hello world!@"
}
//SEG21 print2
// print2(byte* zeropage(2) at)
print2: {
.label at = 2
//SEG22 [10] phi from print2 to print2::@1 [phi:print2->print2::@1]
@ -538,6 +540,7 @@ main: {
hello: .text "hello world!@"
}
//SEG21 print2
// print2(byte* zeropage(2) at)
print2: {
.label at = 2
//SEG22 [10] phi from print2 to print2::@1 [phi:print2->print2::@1]

View File

@ -53,6 +53,7 @@ print_ln: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
lda #<txt

View File

@ -627,6 +627,7 @@ print_ln: {
}
//SEG44 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(5) str)
print_str: {
.label str = 5
//SEG45 [21] phi from print_str to print_str::@1 [phi:print_str->print_str::@1]
@ -885,6 +886,7 @@ print_ln: {
}
//SEG44 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG45 [21] phi from print_str to print_str::@1 [phi:print_str->print_str::@1]
@ -1178,6 +1180,7 @@ print_ln: {
}
//SEG44 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG45 [21] phi from print_str to print_str::@1 [phi:print_str->print_str::@1]

View File

@ -14,6 +14,7 @@ main: {
jsr print_msg
rts
}
// print_msg(byte register(X) idx)
print_msg: {
.label msg = 4
cpx #1
@ -34,6 +35,7 @@ print_msg: {
msg_0: .text "Hello @"
msg_1: .text "World!@"
}
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
b1:

View File

@ -371,6 +371,7 @@ main: {
rts
}
//SEG23 print_msg
// print_msg(byte zeropage(2) idx)
print_msg: {
.label idx = 2
.label msg = 5
@ -419,6 +420,7 @@ print_msg: {
msg_1: .text "World!@"
}
//SEG37 print
// print(byte* zeropage(7) msg)
print: {
.label msg = 7
//SEG38 [17] phi from print print::@2 to print::@1 [phi:print/print::@2->print::@1]
@ -539,6 +541,7 @@ main: {
rts
}
//SEG23 print_msg
// print_msg(byte register(X) idx)
print_msg: {
.label msg = 4
//SEG24 [10] if((byte) print_msg::idx#2==(byte/signed byte/word/signed word/dword/signed dword) 1) goto print_msg::@2 -- vbuxx_eq_vbuc1_then_la1
@ -581,6 +584,7 @@ print_msg: {
msg_1: .text "World!@"
}
//SEG37 print
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
//SEG38 [17] phi from print print::@2 to print::@1 [phi:print/print::@2->print::@1]
@ -741,6 +745,7 @@ main: {
rts
}
//SEG23 print_msg
// print_msg(byte register(X) idx)
print_msg: {
.label msg = 4
//SEG24 [10] if((byte) print_msg::idx#2==(byte/signed byte/word/signed word/dword/signed dword) 1) goto print_msg::@2 -- vbuxx_eq_vbuc1_then_la1
@ -775,6 +780,7 @@ print_msg: {
msg_1: .text "World!@"
}
//SEG37 print
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
//SEG38 [17] phi from print print::@2 to print::@1 [phi:print/print::@2->print::@1]

View File

@ -27,6 +27,7 @@ main: {
msg: .text "message 3 @"
msg2: .text "message 2 @"
}
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
b1:

View File

@ -326,6 +326,7 @@ main: {
msg2: .text "message 2 @"
}
//SEG29 print
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
//SEG30 [12] phi from print print::@2 to print::@1 [phi:print/print::@2->print::@1]
@ -462,6 +463,7 @@ main: {
msg2: .text "message 2 @"
}
//SEG29 print
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
//SEG30 [12] phi from print print::@2 to print::@1 [phi:print/print::@2->print::@1]
@ -631,6 +633,7 @@ main: {
msg2: .text "message 2 @"
}
//SEG29 print
// print(byte* zeropage(4) msg)
print: {
.label msg = 4
//SEG30 [12] phi from print print::@2 to print::@1 [phi:print/print::@2->print::@1]

View File

@ -63,6 +63,7 @@ menu: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(X) key)
keyboard_key_pressed: {
txa
and #7
@ -81,6 +82,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
lda keyboard_matrix_row_bitmask,x
sta CIA1_PORT_A

View File

@ -1511,6 +1511,7 @@ menu: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte zeropage(2) key)
keyboard_key_pressed: {
.label _2 = $d
.label colidx = 9
@ -1562,6 +1563,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte zeropage($b) rowid)
keyboard_matrix_read: {
.label return = $f
.label rowid = $b
@ -1843,6 +1845,7 @@ menu: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(X) key)
keyboard_key_pressed: {
//SEG57 [32] (byte) keyboard_key_pressed::colidx#0 ← (byte) keyboard_key_pressed::key#4 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuyy=vbuxx_band_vbuc1
txa
@ -1876,6 +1879,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
//SEG68 [40] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
@ -2350,6 +2354,7 @@ menu: {
// The key is a keyboard code defined from the keyboard matrix by %00rrrccc, where rrr is the row ID (0-7) and ccc is the column ID (0-7)
// All keys exist as as KEY_XXX constants.
// Returns zero if the key is not pressed and a non-zero value if the key is currently pressed
// keyboard_key_pressed(byte register(X) key)
keyboard_key_pressed: {
//SEG57 [32] (byte) keyboard_key_pressed::colidx#0 ← (byte) keyboard_key_pressed::key#4 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuyy=vbuxx_band_vbuc1
txa
@ -2379,6 +2384,7 @@ keyboard_key_pressed: {
// Returns the keys pressed on the row as bits according to the C64 key matrix.
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
//SEG68 [40] *((const byte*) CIA1_PORT_A#0) ← *((const byte[8]) keyboard_matrix_row_bitmask#0 + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x

View File

@ -81,6 +81,7 @@ main: {
jmp b5
}
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(5) x, byte register(Y) y)
bitmap_plot: {
.label _1 = $b
.label x = 5
@ -112,6 +113,7 @@ bitmap_plot: {
rts
}
// Initialize the points to be animated
// point_init(byte zeropage(2) point_idx)
point_init: {
.label _4 = $e
.label _5 = 5
@ -276,6 +278,7 @@ point_init: {
// Implemented using simple binary division
// Follows the C99 standard by truncating toward zero on negative results.
// See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf section 6.5.5
// divr16s(signed word zeropage($b) divisor, signed word zeropage(9) rem)
divr16s: {
.const dividend = 0
.label _7 = 9
@ -362,6 +365,7 @@ divr16s: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($b) divisor, word zeropage(9) rem)
divr16u: {
.label rem = 9
.label dividend = 3
@ -413,6 +417,7 @@ divr16u: {
rts
}
// Fill the screen with a specific char
// screen_fill(byte* zeropage(3) screen)
screen_fill: {
.const ch = $10
.label screen = 3

View File

@ -3294,6 +3294,7 @@ main: {
}
//SEG56 bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage($28) x, byte zeropage($2a) y)
bitmap_plot: {
.label _1 = $2d
.label _2 = $31
@ -3340,6 +3341,7 @@ bitmap_plot: {
}
//SEG64 point_init
// Initialize the points to be animated
// point_init(byte zeropage($26) point_idx)
point_init: {
.label _4 = $35
.label _5 = $37
@ -3616,6 +3618,7 @@ point_init: {
// Implemented using simple binary division
// Follows the C99 standard by truncating toward zero on negative results.
// See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf section 6.5.5
// divr16s(signed word zeropage($41) divisor, signed word zeropage($43) rem)
divr16s: {
.const dividend = 0
.label _7 = $57
@ -3815,6 +3818,7 @@ divr16s: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($14) dividend, word zeropage($4f) divisor, word zeropage($12) rem)
divr16u: {
.label _1 = $59
.label _2 = $5a
@ -3928,6 +3932,7 @@ divr16u: {
}
//SEG204 screen_fill
// Fill the screen with a specific char
// screen_fill(byte* zeropage($1a) screen)
screen_fill: {
.const ch = $10
.label screen = $1a
@ -4717,6 +4722,7 @@ main: {
}
//SEG56 bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(5) x, byte register(Y) y)
bitmap_plot: {
.label _1 = $b
.label x = 5
@ -4759,6 +4765,7 @@ bitmap_plot: {
}
//SEG64 point_init
// Initialize the points to be animated
// point_init(byte zeropage(2) point_idx)
point_init: {
.label _4 = $e
.label _5 = 5
@ -5005,6 +5012,7 @@ point_init: {
// Implemented using simple binary division
// Follows the C99 standard by truncating toward zero on negative results.
// See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf section 6.5.5
// divr16s(signed word zeropage($b) divisor, signed word zeropage(9) rem)
divr16s: {
.const dividend = 0
.label _7 = 9
@ -5159,6 +5167,7 @@ divr16s: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($b) divisor, word zeropage(9) rem)
divr16u: {
.label rem = 9
.label dividend = 3
@ -5262,6 +5271,7 @@ divr16u: {
}
//SEG204 screen_fill
// Fill the screen with a specific char
// screen_fill(byte* zeropage(3) screen)
screen_fill: {
.const ch = $10
.label screen = 3
@ -5717,8 +5727,8 @@ Removing instruction b10:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing unreachable instruction jmp b2
Succesful ASM optimization Pass5UnreachableCodeElimination
Fixing long branch [157] bmi abs16s1_b1 to bpl
Fixing long branch [166] bmi abs16s2_b1 to bpl
Fixing long branch [159] bmi abs16s1_b1 to bpl
Fixing long branch [168] bmi abs16s2_b1 to bpl
FINAL SYMBOL TABLE
(label) @19
@ -6271,6 +6281,7 @@ main: {
}
//SEG56 bitmap_plot
// Plot a single dot in the bitmap
// bitmap_plot(word zeropage(5) x, byte register(Y) y)
bitmap_plot: {
.label _1 = $b
.label x = 5
@ -6310,6 +6321,7 @@ bitmap_plot: {
}
//SEG64 point_init
// Initialize the points to be animated
// point_init(byte zeropage(2) point_idx)
point_init: {
.label _4 = $e
.label _5 = 5
@ -6531,6 +6543,7 @@ point_init: {
// Implemented using simple binary division
// Follows the C99 standard by truncating toward zero on negative results.
// See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf section 6.5.5
// divr16s(signed word zeropage($b) divisor, signed word zeropage(9) rem)
divr16s: {
.const dividend = 0
.label _7 = 9
@ -6665,6 +6678,7 @@ divr16s: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($b) divisor, word zeropage(9) rem)
divr16u: {
.label rem = 9
.label dividend = 3
@ -6751,6 +6765,7 @@ divr16u: {
}
//SEG204 screen_fill
// Fill the screen with a specific char
// screen_fill(byte* zeropage(3) screen)
screen_fill: {
.const ch = $10
.label screen = 3

View File

@ -204,6 +204,7 @@ print_ln: {
rts
}
// Print a word as HEX
// print_word(word zeropage(5) w)
print_word: {
.label w = 5
lda w+1
@ -215,6 +216,7 @@ print_word: {
rts
}
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
txa
lsr
@ -232,6 +234,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -242,6 +245,7 @@ print_char: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage(5) str)
print_str: {
.label str = 5
b1:
@ -290,6 +294,7 @@ print_cls: {
// Generate word linear table
// lintab - the table to generate into
// length - the number of points in a total sinus wavelength (the size of the table)
// lin16u_gen(word zeropage(5) min, word zeropage(3) max, word* zeropage(7) lintab)
lin16u_gen: {
.label _5 = 5
.label ampl = 3
@ -395,6 +400,7 @@ lin16u_gen: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($d) divisor, word zeropage($f) rem)
divr16u: {
.label rem = $f
.label dividend = 3

View File

@ -2497,6 +2497,7 @@ print_ln: {
}
//SEG172 print_word
// Print a word as HEX
// print_word(word zeropage(5) w)
print_word: {
.label w = 5
//SEG173 [67] (byte) print_byte::b#0 ← > (word) print_word::w#10 -- vbuz1=_hi_vwuz2
@ -2528,6 +2529,7 @@ print_word: {
}
//SEG186 print_byte
// Print a byte as HEX
// print_byte(byte zeropage(7) b)
print_byte: {
.label _0 = $24
.label _2 = $25
@ -2574,6 +2576,7 @@ print_byte: {
}
//SEG202 print_char
// Print a single char
// print_char(byte zeropage(8) ch)
print_char: {
.label ch = 8
//SEG203 [81] *((byte*) print_char_cursor#50) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuz2
@ -2593,6 +2596,7 @@ print_char: {
}
//SEG207 print_str
// Print a zero-terminated string
// print_str(byte* zeropage($b) str)
print_str: {
.label str = $b
//SEG208 [85] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -2676,6 +2680,7 @@ print_cls: {
// Generate word linear table
// lintab - the table to generate into
// length - the number of points in a total sinus wavelength (the size of the table)
// lin16u_gen(word zeropage($11) min, word zeropage($f) max, word* zeropage($17) lintab)
lin16u_gen: {
.label _5 = $34
.label ampl = $26
@ -2856,6 +2861,7 @@ lin16u_gen: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($1f) dividend, word zeropage($1b) divisor, word zeropage($1d) rem)
divr16u: {
.label _1 = $36
.label _2 = $37
@ -3631,6 +3637,7 @@ print_ln: {
}
//SEG172 print_word
// Print a word as HEX
// print_word(word zeropage(5) w)
print_word: {
.label w = 5
//SEG173 [67] (byte) print_byte::b#0 ← > (word) print_word::w#10 -- vbuxx=_hi_vwuz1
@ -3662,6 +3669,7 @@ print_word: {
}
//SEG186 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG187 [73] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -3701,6 +3709,7 @@ print_byte: {
}
//SEG202 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG203 [81] *((byte*) print_char_cursor#50) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
@ -3718,6 +3727,7 @@ print_char: {
}
//SEG207 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(5) str)
print_str: {
.label str = 5
//SEG208 [85] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -3801,6 +3811,7 @@ print_cls: {
// Generate word linear table
// lintab - the table to generate into
// length - the number of points in a total sinus wavelength (the size of the table)
// lin16u_gen(word zeropage(5) min, word zeropage(3) max, word* zeropage(7) lintab)
lin16u_gen: {
.label _5 = 5
.label ampl = 3
@ -3961,6 +3972,7 @@ lin16u_gen: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($d) divisor, word zeropage($f) rem)
divr16u: {
.label rem = $f
.label dividend = 3
@ -4852,6 +4864,7 @@ print_ln: {
}
//SEG172 print_word
// Print a word as HEX
// print_word(word zeropage(5) w)
print_word: {
.label w = 5
//SEG173 [67] (byte) print_byte::b#0 ← > (word) print_word::w#10 -- vbuxx=_hi_vwuz1
@ -4877,6 +4890,7 @@ print_word: {
}
//SEG186 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG187 [73] (byte~) print_byte::$0 ← (byte) print_byte::b#3 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -4910,6 +4924,7 @@ print_byte: {
}
//SEG202 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG203 [81] *((byte*) print_char_cursor#50) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
@ -4925,6 +4940,7 @@ print_char: {
}
//SEG207 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(5) str)
print_str: {
.label str = 5
//SEG208 [85] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -4996,6 +5012,7 @@ print_cls: {
// Generate word linear table
// lintab - the table to generate into
// length - the number of points in a total sinus wavelength (the size of the table)
// lin16u_gen(word zeropage(5) min, word zeropage(3) max, word* zeropage(7) lintab)
lin16u_gen: {
.label _5 = 5
.label ampl = 3
@ -5140,6 +5157,7 @@ lin16u_gen: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(3) dividend, word zeropage($d) divisor, word zeropage($f) rem)
divr16u: {
.label rem = $f
.label dividend = 3

View File

@ -11,11 +11,13 @@ main: {
bne b1
rts
}
// b(byte register(Y) i)
b: {
tya
jsr c
rts
}
// c(byte register(A) i)
c: {
ldx #0
b1:

View File

@ -281,6 +281,7 @@ main: {
rts
}
//SEG23 b
// b(byte zeropage(4) i)
b: {
.label i = 4
//SEG24 [11] (byte) c::i#0 ← (byte) b::i#0 -- vbuz1=vbuz2
@ -297,6 +298,7 @@ b: {
rts
}
//SEG29 c
// c(byte zeropage(5) i)
c: {
.label i = 5
.label j = 3
@ -401,6 +403,7 @@ main: {
rts
}
//SEG23 b
// b(byte register(Y) i)
b: {
//SEG24 [11] (byte) c::i#0 ← (byte) b::i#0 -- vbuaa=vbuyy
tya
@ -415,6 +418,7 @@ b: {
rts
}
//SEG29 c
// c(byte register(A) i)
c: {
//SEG30 [15] phi from c to c::@1 [phi:c->c::@1]
b1_from_c:
@ -550,6 +554,7 @@ main: {
rts
}
//SEG23 b
// b(byte register(Y) i)
b: {
//SEG24 [11] (byte) c::i#0 ← (byte) b::i#0 -- vbuaa=vbuyy
tya
@ -561,6 +566,7 @@ b: {
rts
}
//SEG29 c
// c(byte register(A) i)
c: {
//SEG30 [15] phi from c to c::@1 [phi:c->c::@1]
//SEG31 [15] phi (byte) c::j#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:c->c::@1#0] -- vbuxx=vbuc1

View File

@ -35,6 +35,7 @@ print_set_screen: {
rts
}
// Print a dword as HEX
// print_dword(dword zeropage(9) dw)
print_dword: {
.label dw = 9
lda dw+2
@ -50,6 +51,7 @@ print_dword: {
rts
}
// Print a word as HEX
// print_word(word zeropage(2) w)
print_word: {
.label w = 2
lda w+1
@ -61,6 +63,7 @@ print_word: {
rts
}
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
txa
lsr
@ -78,6 +81,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y

View File

@ -1461,6 +1461,7 @@ print_set_screen: {
}
//SEG38 print_dword
// Print a dword as HEX
// print_dword(dword zeropage($1e) dw)
print_dword: {
.label dw = $1e
//SEG39 [20] (word) print_word::w#0 ← > (dword) print_dword::dw#0 -- vwuz1=_hi_vduz2
@ -1496,6 +1497,7 @@ print_dword: {
}
//SEG52 print_word
// Print a word as HEX
// print_word(word zeropage(2) w)
print_word: {
.label w = 2
//SEG53 [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 -- vbuz1=_hi_vwuz2
@ -1527,6 +1529,7 @@ print_word: {
}
//SEG66 print_byte
// Print a byte as HEX
// print_byte(byte zeropage(4) b)
print_byte: {
.label _0 = $22
.label _2 = $23
@ -1573,6 +1576,7 @@ print_byte: {
}
//SEG82 print_char
// Print a single char
// print_char(byte zeropage(5) ch)
print_char: {
.label ch = 5
//SEG83 [40] *((byte*) print_char_cursor#27) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuz2
@ -2179,6 +2183,7 @@ print_set_screen: {
}
//SEG38 print_dword
// Print a dword as HEX
// print_dword(dword zeropage(9) dw)
print_dword: {
.label dw = 9
//SEG39 [20] (word) print_word::w#0 ← > (dword) print_dword::dw#0 -- vwuz1=_hi_vduz2
@ -2214,6 +2219,7 @@ print_dword: {
}
//SEG52 print_word
// Print a word as HEX
// print_word(word zeropage(2) w)
print_word: {
.label w = 2
//SEG53 [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 -- vbuxx=_hi_vwuz1
@ -2245,6 +2251,7 @@ print_word: {
}
//SEG66 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG67 [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -2284,6 +2291,7 @@ print_byte: {
}
//SEG82 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG83 [40] *((byte*) print_char_cursor#27) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
@ -2956,6 +2964,7 @@ print_set_screen: {
}
//SEG38 print_dword
// Print a dword as HEX
// print_dword(dword zeropage(9) dw)
print_dword: {
.label dw = 9
//SEG39 [20] (word) print_word::w#0 ← > (dword) print_dword::dw#0 -- vwuz1=_hi_vduz2
@ -2985,6 +2994,7 @@ print_dword: {
}
//SEG52 print_word
// Print a word as HEX
// print_word(word zeropage(2) w)
print_word: {
.label w = 2
//SEG53 [26] (byte) print_byte::b#0 ← > (word) print_word::w#2 -- vbuxx=_hi_vwuz1
@ -3010,6 +3020,7 @@ print_word: {
}
//SEG66 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG67 [32] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -3043,6 +3054,7 @@ print_byte: {
}
//SEG82 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG83 [40] *((byte*) print_char_cursor#27) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0

View File

@ -40,6 +40,7 @@ main: {
}
// Generate one 5x3 character from a 16-bit char spec
// The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0
// gen_char3(byte* zeropage(2) dst, word zeropage(6) spec)
gen_char3: {
.label dst = 2
.label spec = 6

View File

@ -593,6 +593,7 @@ main: {
//SEG30 gen_char3
// Generate one 5x3 character from a 16-bit char spec
// The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0
// gen_char3(byte* zeropage($a) dst, word zeropage(6) spec)
gen_char3: {
.label _0 = $c
.label _1 = $d
@ -833,6 +834,7 @@ main: {
//SEG30 gen_char3
// Generate one 5x3 character from a 16-bit char spec
// The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0
// gen_char3(byte* zeropage(2) dst, word zeropage(6) spec)
gen_char3: {
.label dst = 2
.label spec = 6
@ -1112,6 +1114,7 @@ main: {
//SEG30 gen_char3
// Generate one 5x3 character from a 16-bit char spec
// The 5x3 char is stored as 5x 3-bit rows followed by a zero. %aaabbbcc cdddeee0
// gen_char3(byte* zeropage(2) dst, word zeropage(6) spec)
gen_char3: {
.label dst = 2
.label spec = 6

View File

@ -18,6 +18,7 @@ main: {
bne b2
rts
}
// line(byte register(X) l)
line: {
txa
jsr plot
@ -27,6 +28,7 @@ line: {
jsr plot
rts
}
// plot(byte register(A) x)
plot: {
tay
lda #'*'

View File

@ -377,6 +377,7 @@ main: {
rts
}
//SEG37 line
// line(byte zeropage(4) l)
line: {
.label l = 4
//SEG38 [17] (byte) plot::x#0 ← (byte) line::l#2 -- vbuz1=vbuz2
@ -407,6 +408,7 @@ line: {
rts
}
//SEG49 plot
// plot(byte zeropage(5) x)
plot: {
.label x = 5
//SEG50 [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2
@ -528,6 +530,7 @@ main: {
rts
}
//SEG37 line
// line(byte register(X) l)
line: {
//SEG38 [17] (byte) plot::x#0 ← (byte) line::l#2 -- vbuaa=vbuxx
txa
@ -555,6 +558,7 @@ line: {
rts
}
//SEG49 plot
// plot(byte register(A) x)
plot: {
//SEG50 [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuaa=vbuc2
tay
@ -710,6 +714,7 @@ main: {
rts
}
//SEG37 line
// line(byte register(X) l)
line: {
//SEG38 [17] (byte) plot::x#0 ← (byte) line::l#2 -- vbuaa=vbuxx
txa
@ -731,6 +736,7 @@ line: {
rts
}
//SEG49 plot
// plot(byte register(A) x)
plot: {
//SEG50 [23] *((const byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' -- pbuc1_derefidx_vbuaa=vbuc2
tay

View File

@ -25,6 +25,7 @@ main: {
bne b3
rts
}
// plot(byte register(X) x)
plot: {
lda #'*'
sta SCREEN,x

View File

@ -411,6 +411,7 @@ main: {
rts
}
//SEG49 plot
// plot(byte zeropage(5) x)
plot: {
.label x = 5
//SEG50 [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuz1=vbuc2
@ -554,6 +555,7 @@ main: {
rts
}
//SEG49 plot
// plot(byte register(X) x)
plot: {
//SEG50 [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2
lda #'*'
@ -728,6 +730,7 @@ main: {
rts
}
//SEG49 plot
// plot(byte register(X) x)
plot: {
//SEG50 [22] *((const byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' -- pbuc1_derefidx_vbuxx=vbuc2
lda #'*'

View File

@ -61,6 +61,7 @@ print_ln: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
b1:

View File

@ -590,6 +590,7 @@ print_ln: {
}
//SEG52 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG53 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -807,6 +808,7 @@ print_ln: {
}
//SEG52 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG53 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -1068,6 +1070,7 @@ print_ln: {
}
//SEG52 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG53 [23] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]

View File

@ -27,6 +27,7 @@ main: {
bne b1
rts
}
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
.const y = $32
.label spriteno = 4

View File

@ -728,6 +728,7 @@ main: {
rts
}
//SEG27 position_sprite
// position_sprite(byte zeropage(5) spriteno, word zeropage(6) x)
position_sprite: {
.const y = $32
.label _0 = 8
@ -945,6 +946,7 @@ main: {
rts
}
//SEG27 position_sprite
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
.const y = $32
.label spriteno = 4
@ -1227,6 +1229,7 @@ main: {
rts
}
//SEG27 position_sprite
// position_sprite(byte zeropage(4) spriteno, word zeropage(2) x)
position_sprite: {
.const y = $32
.label spriteno = 4

View File

@ -55,6 +55,7 @@ main: {
b3:
jmp b3
}
// draw_block(byte register(A) tileno, byte register(Y) x, byte register(X) y)
draw_block: {
.label tileno = 8
.label x1 = 9
@ -166,6 +167,7 @@ draw_block: {
rts
}
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a)
mul8u: {
.const b = $28
.label mb = 6
@ -233,6 +235,7 @@ init: {
rts
}
// Fill some memory with a value
// fill(byte register(X) val)
fill: {
.label end = 6
.label addr = 4

View File

@ -1808,6 +1808,7 @@ main: {
jmp b3_from_b3
}
//SEG37 draw_block
// draw_block(byte zeropage($e) tileno, byte zeropage($f) x, byte zeropage($10) y)
draw_block: {
.label _1 = $12
.label tileno = $e
@ -1968,6 +1969,7 @@ draw_block: {
}
//SEG60 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte zeropage(4) a)
mul8u: {
.const b = $28
.label _1 = $1d
@ -2116,6 +2118,7 @@ init: {
}
//SEG109 fill
// Fill some memory with a value
// fill(byte zeropage(9) val)
fill: {
.label end = $1e
.label addr = $a
@ -2444,6 +2447,7 @@ main: {
jmp b3_from_b3
}
//SEG37 draw_block
// draw_block(byte register(A) tileno, byte register(Y) x, byte register(X) y)
draw_block: {
.label tileno = 8
.label x1 = 9
@ -2583,6 +2587,7 @@ draw_block: {
}
//SEG60 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a)
mul8u: {
.const b = $28
.label mb = 6
@ -2726,6 +2731,7 @@ init: {
}
//SEG109 fill
// Fill some memory with a value
// fill(byte register(X) val)
fill: {
.label end = 6
.label addr = 4
@ -3273,6 +3279,7 @@ main: {
jmp b3
}
//SEG37 draw_block
// draw_block(byte register(A) tileno, byte register(Y) x, byte register(X) y)
draw_block: {
.label tileno = 8
.label x1 = 9
@ -3407,6 +3414,7 @@ draw_block: {
}
//SEG60 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a)
mul8u: {
.const b = $28
.label mb = 6
@ -3523,6 +3531,7 @@ init: {
}
//SEG109 fill
// Fill some memory with a value
// fill(byte register(X) val)
fill: {
.label end = 6
.label addr = 4

View File

@ -97,6 +97,7 @@ print_ln: {
rts
}
// Print a word as HEX
// print_word(word zeropage(7) w)
print_word: {
.label w = 7
lda w+1
@ -108,6 +109,7 @@ print_word: {
rts
}
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
txa
lsr
@ -125,6 +127,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -164,6 +167,7 @@ addMEMtoFAC: {
rts
}
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage(7) mem)
prepareMEM: {
.label mem = 7
lda mem
@ -175,6 +179,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage(7) mem)
mulFACbyMEM: {
.label mem = 7
jsr prepareMEM
@ -206,6 +211,7 @@ divMEMbyFAC: {
}
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage(7) w)
setFAC: {
.label w = 7
jsr prepareMEM
@ -218,6 +224,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage(7) mem)
setMEMtoFAC: {
.label mem = 7
jsr prepareMEM

View File

@ -1329,6 +1329,7 @@ print_ln: {
}
//SEG92 print_word
// Print a word as HEX
// print_word(word zeropage($13) w)
print_word: {
.label w = $13
//SEG93 [43] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuz1=_hi_vwuz2
@ -1360,6 +1361,7 @@ print_word: {
}
//SEG106 print_byte
// Print a byte as HEX
// print_byte(byte zeropage(5) b)
print_byte: {
.label _0 = $15
.label _2 = $16
@ -1406,6 +1408,7 @@ print_byte: {
}
//SEG122 print_char
// Print a single char
// print_char(byte zeropage(6) ch)
print_char: {
.label ch = 6
//SEG123 [57] *((byte*) print_char_cursor#23) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuz2
@ -1475,6 +1478,7 @@ addMEMtoFAC: {
}
//SEG140 prepareMEM
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage(9) mem)
prepareMEM: {
.label _0 = $19
.label _1 = $1a
@ -1501,6 +1505,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage($b) mem)
mulFACbyMEM: {
.label mem = $b
//SEG148 [74] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2 -- pbuz1=pbuz2
@ -1569,6 +1574,7 @@ divMEMbyFAC: {
//SEG168 setFAC
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage($d) w)
setFAC: {
.label w = $d
//SEG169 [85] (byte*~) prepareMEM::mem#7 ← (byte*)(word) setFAC::w#3 -- pbuz1=pbuz2
@ -1599,6 +1605,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage($f) mem)
setMEMtoFAC: {
.label mem = $f
//SEG178 [90] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#2 -- pbuz1=pbuz2
@ -2004,6 +2011,7 @@ print_ln: {
}
//SEG92 print_word
// Print a word as HEX
// print_word(word zeropage(7) w)
print_word: {
.label w = 7
//SEG93 [43] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuxx=_hi_vwuz1
@ -2035,6 +2043,7 @@ print_word: {
}
//SEG106 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG107 [49] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -2074,6 +2083,7 @@ print_byte: {
}
//SEG122 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG123 [57] *((byte*) print_char_cursor#23) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
@ -2140,6 +2150,7 @@ addMEMtoFAC: {
}
//SEG140 prepareMEM
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage(7) mem)
prepareMEM: {
.label mem = 7
//SEG141 [68] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 -- vbuaa=_lo_pbuz1
@ -2160,6 +2171,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage(7) mem)
mulFACbyMEM: {
.label mem = 7
//SEG148 [74] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2
@ -2224,6 +2236,7 @@ divMEMbyFAC: {
//SEG168 setFAC
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage(7) w)
setFAC: {
.label w = 7
//SEG169 [85] (byte*~) prepareMEM::mem#7 ← (byte*)(word) setFAC::w#3
@ -2250,6 +2263,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage(7) mem)
setMEMtoFAC: {
.label mem = 7
//SEG178 [90] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#2
@ -2729,6 +2743,7 @@ print_ln: {
}
//SEG92 print_word
// Print a word as HEX
// print_word(word zeropage(7) w)
print_word: {
.label w = 7
//SEG93 [43] (byte) print_byte::b#0 ← > (word) print_word::w#0 -- vbuxx=_hi_vwuz1
@ -2754,6 +2769,7 @@ print_word: {
}
//SEG106 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG107 [49] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -2787,6 +2803,7 @@ print_byte: {
}
//SEG122 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG123 [57] *((byte*) print_char_cursor#23) ← (byte) print_char::ch#2 -- _deref_pbuz1=vbuaa
ldy #0
@ -2844,6 +2861,7 @@ addMEMtoFAC: {
}
//SEG140 prepareMEM
// Prepare MEM pointers for operations using MEM
// prepareMEM(byte* zeropage(7) mem)
prepareMEM: {
.label mem = 7
//SEG141 [68] (byte~) prepareMEM::$0 ← < (byte*) prepareMEM::mem#5 -- vbuaa=_lo_pbuz1
@ -2862,6 +2880,7 @@ prepareMEM: {
// FAC = MEM*FAC
// Set FAC to MEM (float saved in memory) multiplied by FAC (float accumulator)
// Reads 5 bytes from memory
// mulFACbyMEM(byte* zeropage(7) mem)
mulFACbyMEM: {
.label mem = 7
//SEG148 [74] (byte*) prepareMEM::mem#4 ← (byte*) mulFACbyMEM::mem#2
@ -2914,6 +2933,7 @@ divMEMbyFAC: {
//SEG168 setFAC
// FAC = word
// Set the FAC (floating point accumulator) to the integer value of a 16bit word
// setFAC(word zeropage(7) w)
setFAC: {
.label w = 7
//SEG169 [85] (byte*~) prepareMEM::mem#7 ← (byte*)(word) setFAC::w#3
@ -2935,6 +2955,7 @@ setFAC: {
// MEM = FAC
// Stores the value of the FAC to memory
// Stores 5 bytes (means it is necessary to allocate 5 bytes to avoid clobbering other data using eg. byte[] mem = {0, 0, 0, 0, 0};)
// setMEMtoFAC(byte* zeropage(7) mem)
setMEMtoFAC: {
.label mem = 7
//SEG178 [90] (byte*) prepareMEM::mem#1 ← (byte*) setMEMtoFAC::mem#2

View File

@ -66,6 +66,7 @@ main: {
sintab1: .fill 2*$78, 0
}
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
b1:
@ -89,6 +90,7 @@ print_str: {
jmp b1
}
// Print a signed word as HEX
// print_sword(signed word zeropage(6) w)
print_sword: {
.label w = 6
lda w+1
@ -119,6 +121,7 @@ print_word: {
rts
}
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
txa
lsr
@ -136,6 +139,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -171,6 +175,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = 6
.label step = $1b
@ -244,6 +249,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($f) x)
sin16s: {
.label _6 = $f
.label x = $f
@ -419,6 +425,7 @@ sin16s: {
}
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage(8) v1, word zeropage($13) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $f
.label _1 = $f
@ -449,6 +456,7 @@ mulu16_sel: {
rts
}
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($15) a, word zeropage($13) b)
mul16u: {
.label mb = $17
.label a = $15
@ -537,6 +545,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4

View File

@ -2561,6 +2561,7 @@ main: {
}
//SEG48 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG49 [22] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -2602,6 +2603,7 @@ print_str: {
}
//SEG60 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage(6) w)
print_sword: {
.label w = 6
//SEG61 [28] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -2681,6 +2683,7 @@ print_word: {
}
//SEG91 print_byte
// Print a byte as HEX
// print_byte(byte zeropage(8) b)
print_byte: {
.label _0 = $35
.label _2 = $36
@ -2727,6 +2730,7 @@ print_byte: {
}
//SEG107 print_char
// Print a single char
// print_char(byte zeropage(9) ch)
print_char: {
.label ch = 9
//SEG108 [49] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuz2
@ -2788,6 +2792,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage($12) sintab)
sin16s_gen: {
.label _1 = $41
.label step = $3b
@ -2925,6 +2930,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($17) x)
sin16s: {
.label _6 = $43
.label x = $17
@ -3282,6 +3288,7 @@ sin16s: {
//SEG231 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($1d) v1, word zeropage($1f) v2, byte zeropage($21) select)
mulu16_sel: {
.label _0 = $69
.label _1 = $6d
@ -3359,6 +3366,7 @@ mulu16_sel: {
}
//SEG242 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($22) a, word zeropage($63) b)
mul16u: {
.label _1 = $73
.label mb = $28
@ -3531,6 +3539,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($2e) dividend, word zeropage($2c) rem)
divr16u: {
.label _1 = $80
.label _2 = $81
@ -4105,6 +4114,7 @@ main: {
}
//SEG48 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG49 [22] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -4146,6 +4156,7 @@ print_str: {
}
//SEG60 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage(6) w)
print_sword: {
.label w = 6
//SEG61 [28] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -4224,6 +4235,7 @@ print_word: {
}
//SEG91 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG92 [41] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -4263,6 +4275,7 @@ print_byte: {
}
//SEG107 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG108 [49] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa
ldy #0
@ -4322,6 +4335,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = 6
.label step = $1b
@ -4435,6 +4449,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($f) x)
sin16s: {
.label _6 = $f
.label x = $f
@ -4724,6 +4739,7 @@ sin16s: {
//SEG231 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage(8) v1, word zeropage($13) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $f
.label _1 = $f
@ -4769,6 +4785,7 @@ mulu16_sel: {
}
//SEG242 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($15) a, word zeropage($13) b)
mul16u: {
.label mb = $17
.label a = $15
@ -4921,6 +4938,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4
@ -5625,6 +5643,7 @@ main: {
}
//SEG48 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(4) str)
print_str: {
.label str = 4
//SEG49 [22] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -5660,6 +5679,7 @@ print_str: {
}
//SEG60 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage(6) w)
print_sword: {
.label w = 6
//SEG61 [28] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -5721,6 +5741,7 @@ print_word: {
}
//SEG91 print_byte
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
//SEG92 [41] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuxx_ror_4
txa
@ -5754,6 +5775,7 @@ print_byte: {
}
//SEG107 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG108 [49] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa
ldy #0
@ -5805,6 +5827,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = 6
.label step = $1b
@ -5905,6 +5928,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($f) x)
sin16s: {
.label _6 = $f
.label x = $f
@ -6161,6 +6185,7 @@ sin16s: {
//SEG231 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage(8) v1, word zeropage($13) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $f
.label _1 = $f
@ -6202,6 +6227,7 @@ mulu16_sel: {
}
//SEG242 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($15) a, word zeropage($13) b)
mul16u: {
.label mb = $17
.label a = $15
@ -6333,6 +6359,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4

View File

@ -83,6 +83,7 @@ main: {
sintab2: .fill 2*$78, 0
}
// Print a zero-terminated string
// print_str(byte* zeropage(6) str)
print_str: {
.label str = 6
b1:
@ -106,6 +107,7 @@ print_str: {
jmp b1
}
// Print a signed word as HEX
// print_sword(signed word zeropage(8) w)
print_sword: {
.label w = 8
lda w+1
@ -136,6 +138,7 @@ print_word: {
rts
}
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label b = $a
lda b
@ -154,6 +157,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -189,6 +193,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_genb(signed word* zeropage(2) sintab)
sin16s_genb: {
.label _2 = 8
.label step = $1d
@ -258,6 +263,7 @@ sin16s_genb: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16sb(word zeropage(6) x)
sin16sb: {
.label x = 6
.label return = 8
@ -398,6 +404,7 @@ sin16sb: {
}
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($b) v1, word zeropage($11) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $15
.label _1 = $15
@ -432,6 +439,7 @@ mulu16_sel: {
rts
}
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($13) a, word zeropage($11) b)
mul16u: {
.label mb = $19
.label a = $13
@ -520,6 +528,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4
@ -572,6 +581,7 @@ divr16u: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = 6
.label step = $1d
@ -645,6 +655,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($15) x)
sin16s: {
.label _6 = $15
.label x = $15

View File

@ -3367,6 +3367,7 @@ main: {
}
//SEG58 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(7) str)
print_str: {
.label str = 7
//SEG59 [26] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -3408,6 +3409,7 @@ print_str: {
}
//SEG70 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage(9) w)
print_sword: {
.label w = 9
//SEG71 [32] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -3487,6 +3489,7 @@ print_word: {
}
//SEG101 print_byte
// Print a byte as HEX
// print_byte(byte zeropage($b) b)
print_byte: {
.label _0 = $45
.label _2 = $46
@ -3533,6 +3536,7 @@ print_byte: {
}
//SEG117 print_char
// Print a single char
// print_char(byte zeropage($c) ch)
print_char: {
.label ch = $c
//SEG118 [53] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuz2
@ -3594,6 +3598,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_genb(signed word* zeropage($15) sintab)
sin16s_genb: {
.label _2 = $51
.label step = $4b
@ -3727,6 +3732,7 @@ sin16s_genb: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16sb(word zeropage($1a) x)
sin16sb: {
.label x = $1a
.label return = $4f
@ -4044,6 +4050,7 @@ sin16sb: {
//SEG240 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($1e) v1, word zeropage($20) v2, byte zeropage($22) select)
mulu16_sel: {
.label _0 = $75
.label _1 = $79
@ -4126,6 +4133,7 @@ mulu16_sel: {
}
//SEG251 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($23) a, word zeropage($6f) b)
mul16u: {
.label _1 = $7f
.label mb = $29
@ -4299,6 +4307,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($2f) dividend, word zeropage($2d) rem)
divr16u: {
.label _1 = $8c
.label _2 = $8d
@ -4422,6 +4431,7 @@ divr16u: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage($38) sintab)
sin16s_gen: {
.label _1 = $9a
.label step = $94
@ -4559,6 +4569,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($3d) x)
sin16s: {
.label _6 = $9c
.label x = $3d
@ -5540,6 +5551,7 @@ main: {
}
//SEG58 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(6) str)
print_str: {
.label str = 6
//SEG59 [26] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -5581,6 +5593,7 @@ print_str: {
}
//SEG70 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage(8) w)
print_sword: {
.label w = 8
//SEG71 [32] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -5659,6 +5672,7 @@ print_word: {
}
//SEG101 print_byte
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label b = $a
//SEG102 [45] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuz1_ror_4
@ -5699,6 +5713,7 @@ print_byte: {
}
//SEG117 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG118 [53] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa
ldy #0
@ -5758,6 +5773,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_genb(signed word* zeropage(2) sintab)
sin16s_genb: {
.label _2 = 8
.label step = $1d
@ -5867,6 +5883,7 @@ sin16s_genb: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16sb(word zeropage(6) x)
sin16sb: {
.label x = 6
.label return = 8
@ -6120,6 +6137,7 @@ sin16sb: {
//SEG240 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($b) v1, word zeropage($11) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $15
.label _1 = $15
@ -6169,6 +6187,7 @@ mulu16_sel: {
}
//SEG251 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($13) a, word zeropage($11) b)
mul16u: {
.label mb = $19
.label a = $13
@ -6321,6 +6340,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4
@ -6429,6 +6449,7 @@ divr16u: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = 6
.label step = $1d
@ -6542,6 +6563,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($15) x)
sin16s: {
.label _6 = $15
.label x = $15
@ -7600,6 +7622,7 @@ main: {
}
//SEG58 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(6) str)
print_str: {
.label str = 6
//SEG59 [26] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -7635,6 +7658,7 @@ print_str: {
}
//SEG70 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage(8) w)
print_sword: {
.label w = 8
//SEG71 [32] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -7696,6 +7720,7 @@ print_word: {
}
//SEG101 print_byte
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label b = $a
//SEG102 [45] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuz1_ror_4
@ -7730,6 +7755,7 @@ print_byte: {
}
//SEG117 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG118 [53] *((byte*) print_char_cursor#33) ← (byte) print_char::ch#3 -- _deref_pbuz1=vbuaa
ldy #0
@ -7781,6 +7807,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_genb(signed word* zeropage(2) sintab)
sin16s_genb: {
.label _2 = 8
.label step = $1d
@ -7877,6 +7904,7 @@ sin16s_genb: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16sb(word zeropage(6) x)
sin16sb: {
.label x = 6
.label return = 8
@ -8097,6 +8125,7 @@ sin16sb: {
//SEG240 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($b) v1, word zeropage($11) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $15
.label _1 = $15
@ -8142,6 +8171,7 @@ mulu16_sel: {
}
//SEG251 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($13) a, word zeropage($11) b)
mul16u: {
.label mb = $19
.label a = $13
@ -8273,6 +8303,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4
@ -8362,6 +8393,7 @@ divr16u: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = 6
.label step = $1d
@ -8462,6 +8494,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($15) x)
sin16s: {
.label _6 = $15
.label x = $15

View File

@ -49,6 +49,7 @@ main: {
sintabref: .byte 0, 4, 8, $c, $11, $15, $19, $1d, $21, $25, $29, $2d, $31, $35, $38, $3c, $40, $43, $47, $4a, $4e, $51, $54, $57, $5a, $5d, $60, $63, $65, $68, $6a, $6c, $6e, $70, $72, $74, $76, $77, $79, $7a, $7b, $7c, $7d, $7e, $7e, $7f, $7f, $7f, $80, $7f, $7f, $7f, $7e, $7e, $7d, $7c, $7b, $7a, $79, $77, $76, $74, $72, $70, $6e, $6c, $6a, $68, $65, $63, $60, $5d, $5a, $57, $54, $51, $4e, $4a, $47, $43, $40, $3c, $38, $35, $31, $2d, $29, $25, $21, $1d, $19, $15, $11, $c, 8, 4, 0, $fc, $f8, $f4, $ef, $eb, $e7, $e3, $df, $db, $d7, $d3, $cf, $cb, $c8, $c4, $c0, $bd, $b9, $b6, $b2, $af, $ac, $a9, $a6, $a3, $a0, $9d, $9b, $98, $96, $94, $92, $90, $8e, $8c, $8a, $89, $87, $86, $85, $84, $83, $82, $82, $81, $81, $81, $81, $81, $81, $81, $82, $82, $83, $84, $85, $86, $87, $89, $8a, $8c, $8e, $90, $92, $94, $96, $98, $9b, $9d, $a0, $a3, $a6, $a9, $ac, $af, $b2, $b6, $b9, $bd, $c0, $c4, $c8, $cb, $cf, $d3, $d7, $db, $df, $e3, $e7, $eb, $ef, $f4, $f8, $fc
}
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
b1:
@ -72,6 +73,7 @@ print_str: {
jmp b1
}
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(4) b)
print_sbyte: {
.label b = 4
lda b
@ -92,6 +94,7 @@ print_sbyte: {
jmp b2
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -144,6 +147,7 @@ print_cls: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage(5) sintab)
sin8s_gen: {
.label step = $e
.label sintab = 5
@ -197,6 +201,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage(9) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -308,6 +313,7 @@ sin8s: {
}
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($b) select)
mulu8_sel: {
.label _0 = 9
.label _1 = 9
@ -326,6 +332,7 @@ mulu8_sel: {
rts
}
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $c
.label res = 9
@ -372,6 +379,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(5) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 5

View File

@ -2425,6 +2425,7 @@ main: {
}
//SEG48 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(3) str)
print_str: {
.label str = 3
//SEG49 [22] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -2466,6 +2467,7 @@ print_str: {
}
//SEG60 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(5) b)
print_sbyte: {
.label b = 5
//SEG61 [28] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -2524,6 +2526,7 @@ print_sbyte: {
}
//SEG82 print_char
// Print a single char
// print_char(byte zeropage(6) ch)
print_char: {
.label ch = 6
//SEG83 [38] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuz2
@ -2630,6 +2633,7 @@ print_cls: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage($d) sintab)
sin8s_gen: {
.label _1 = $2d
.label step = $2a
@ -2737,6 +2741,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($12) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -3022,6 +3027,7 @@ sin8s: {
//SEG228 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte zeropage($16) v1, byte zeropage($17) v2, byte zeropage($18) select)
mulu8_sel: {
.label _0 = $40
.label _1 = $42
@ -3079,6 +3085,7 @@ mulu8_sel: {
}
//SEG239 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte zeropage($19) a, byte zeropage($3d) b)
mul8u: {
.label _1 = $45
.label mb = $1c
@ -3188,6 +3195,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($20) dividend, word zeropage($1e) rem)
divr16u: {
.label _1 = $4a
.label _2 = $4b
@ -3692,6 +3700,7 @@ main: {
}
//SEG48 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG49 [22] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -3733,6 +3742,7 @@ print_str: {
}
//SEG60 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(4) b)
print_sbyte: {
.label b = 4
//SEG61 [28] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -3789,6 +3799,7 @@ print_sbyte: {
}
//SEG82 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG83 [38] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa
ldy #0
@ -3887,6 +3898,7 @@ print_cls: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage(5) sintab)
sin8s_gen: {
.label step = $e
.label sintab = 5
@ -3980,6 +3992,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage(9) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -4214,6 +4227,7 @@ sin8s: {
//SEG228 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($b) select)
mulu8_sel: {
.label _0 = 9
.label _1 = 9
@ -4247,6 +4261,7 @@ mulu8_sel: {
}
//SEG239 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $c
.label res = 9
@ -4342,6 +4357,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(5) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 5
@ -5041,6 +5057,7 @@ main: {
}
//SEG48 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG49 [22] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -5076,6 +5093,7 @@ print_str: {
}
//SEG60 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(4) b)
print_sbyte: {
.label b = 4
//SEG61 [28] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -5118,6 +5136,7 @@ print_sbyte: {
}
//SEG82 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG83 [38] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa
ldy #0
@ -5202,6 +5221,7 @@ print_cls: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage(5) sintab)
sin8s_gen: {
.label step = $e
.label sintab = 5
@ -5282,6 +5302,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage(9) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -5480,6 +5501,7 @@ sin8s: {
//SEG228 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($b) select)
mulu8_sel: {
.label _0 = 9
.label _1 = 9
@ -5509,6 +5531,7 @@ mulu8_sel: {
}
//SEG239 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $c
.label res = 9
@ -5587,6 +5610,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(5) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 5

View File

@ -81,6 +81,7 @@ main: {
sintabw: .fill 2*$c0, 0
}
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
b1:
@ -104,6 +105,7 @@ print_str: {
jmp b1
}
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(4) b)
print_sbyte: {
.label b = 4
lda b
@ -124,6 +126,7 @@ print_sbyte: {
jmp b2
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -176,6 +179,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = $f
.label step = $1c
@ -249,6 +253,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($b) x)
sin16s: {
.label _6 = $b
.label x = $b
@ -424,6 +429,7 @@ sin16s: {
}
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($11) v1, word zeropage($13) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $b
.label _1 = $b
@ -454,6 +460,7 @@ mulu16_sel: {
rts
}
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($15) a, word zeropage($13) b)
mul16u: {
.label mb = $17
.label a = $15
@ -542,6 +549,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(5) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 5
@ -594,6 +602,7 @@ divr16u: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage(5) sintab)
sin8s_gen: {
.label step = $f
.label sintab = 5
@ -647,6 +656,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($13) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -758,6 +768,7 @@ sin8s: {
}
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($1b) select)
mulu8_sel: {
.label _0 = $13
.label _1 = $13
@ -776,6 +787,7 @@ mulu8_sel: {
rts
}
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $15
.label res = $13

View File

@ -3691,6 +3691,7 @@ main: {
}
//SEG58 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(3) str)
print_str: {
.label str = 3
//SEG59 [30] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -3732,6 +3733,7 @@ print_str: {
}
//SEG70 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(5) b)
print_sbyte: {
.label b = 5
//SEG71 [36] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -3790,6 +3792,7 @@ print_sbyte: {
}
//SEG92 print_char
// Print a single char
// print_char(byte zeropage(6) ch)
print_char: {
.label ch = 6
//SEG93 [46] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuz2
@ -3896,6 +3899,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage($f) sintab)
sin16s_gen: {
.label _1 = $5a
.label step = $54
@ -4033,6 +4037,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($14) x)
sin16s: {
.label _6 = $5c
.label x = $14
@ -4390,6 +4395,7 @@ sin16s: {
//SEG232 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($1a) v1, word zeropage($1c) v2, byte zeropage($1e) select)
mulu16_sel: {
.label _0 = $82
.label _1 = $86
@ -4467,6 +4473,7 @@ mulu16_sel: {
}
//SEG243 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($1f) a, word zeropage($7c) b)
mul16u: {
.label _1 = $8c
.label mb = $25
@ -4639,6 +4646,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($2b) dividend, word zeropage($29) rem)
divr16u: {
.label _1 = $99
.label _2 = $9a
@ -4763,6 +4771,7 @@ divr16u: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage($32) sintab)
sin8s_gen: {
.label _1 = $a2
.label step = $9f
@ -4870,6 +4879,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($37) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -5155,6 +5165,7 @@ sin8s: {
//SEG437 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte zeropage($3b) v1, byte zeropage($3c) v2, byte zeropage($3d) select)
mulu8_sel: {
.label _0 = $b5
.label _1 = $b7
@ -5212,6 +5223,7 @@ mulu8_sel: {
}
//SEG448 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte zeropage($3e) a, byte zeropage($b2) b)
mul8u: {
.label _1 = $ba
.label mb = $41
@ -5984,6 +5996,7 @@ main: {
}
//SEG58 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG59 [30] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -6025,6 +6038,7 @@ print_str: {
}
//SEG70 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(4) b)
print_sbyte: {
.label b = 4
//SEG71 [36] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -6081,6 +6095,7 @@ print_sbyte: {
}
//SEG92 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG93 [46] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa
ldy #0
@ -6179,6 +6194,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = $f
.label step = $1c
@ -6292,6 +6308,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($b) x)
sin16s: {
.label _6 = $b
.label x = $b
@ -6581,6 +6598,7 @@ sin16s: {
//SEG232 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($11) v1, word zeropage($13) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $b
.label _1 = $b
@ -6626,6 +6644,7 @@ mulu16_sel: {
}
//SEG243 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($15) a, word zeropage($13) b)
mul16u: {
.label mb = $17
.label a = $15
@ -6778,6 +6797,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(5) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 5
@ -6886,6 +6906,7 @@ divr16u: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage(5) sintab)
sin8s_gen: {
.label step = $f
.label sintab = 5
@ -6979,6 +7000,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($13) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -7213,6 +7235,7 @@ sin8s: {
//SEG437 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($1b) select)
mulu8_sel: {
.label _0 = $13
.label _1 = $13
@ -7246,6 +7269,7 @@ mulu8_sel: {
}
//SEG448 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $15
.label res = $13
@ -8215,6 +8239,7 @@ main: {
}
//SEG58 print_str
// Print a zero-terminated string
// print_str(byte* zeropage(2) str)
print_str: {
.label str = 2
//SEG59 [30] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -8250,6 +8275,7 @@ print_str: {
}
//SEG70 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage(4) b)
print_sbyte: {
.label b = 4
//SEG71 [36] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -8292,6 +8318,7 @@ print_sbyte: {
}
//SEG92 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG93 [46] *((byte*) print_char_cursor#29) ← (byte) print_char::ch#4 -- _deref_pbuz1=vbuaa
ldy #0
@ -8376,6 +8403,7 @@ print_cls: {
// Generate signed (large) word sinus table - on the full -$7fff - $7fff range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin16s_gen(signed word* zeropage(2) sintab)
sin16s_gen: {
.label _1 = $f
.label step = $1c
@ -8476,6 +8504,7 @@ sin16s_gen: {
// Calculate signed word sinus sin(x)
// x: unsigned dword input u[4.28] in the interval $00000000 - PI2_u4f28
// result: signed word sin(x) s[0.15] - using the full range -$7fff - $7fff
// sin16s(dword zeropage($b) x)
sin16s: {
.label _6 = $b
.label x = $b
@ -8732,6 +8761,7 @@ sin16s: {
//SEG232 mulu16_sel
// Calculate val*val for two unsigned word values - the result is 16 selected bits of the 32-bit result.
// The select parameter indicates how many of the highest bits of the 32-bit result to skip
// mulu16_sel(word zeropage($11) v1, word zeropage($13) v2, byte register(X) select)
mulu16_sel: {
.label _0 = $b
.label _1 = $b
@ -8773,6 +8803,7 @@ mulu16_sel: {
}
//SEG243 mul16u
// Perform binary multiplication of two unsigned 16-bit words into a 32-bit unsigned double word
// mul16u(word zeropage($15) a, word zeropage($13) b)
mul16u: {
.label mb = $17
.label a = $15
@ -8904,6 +8935,7 @@ div32u16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(5) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 5
@ -8993,6 +9025,7 @@ divr16u: {
// Generate signed byte sinus table - on the full -$7f - $7f range
// sintab - the table to generate into
// wavelength - the number of sinus points in a total sinus wavelength (the size of the table)
// sin8s_gen(signed byte* zeropage(5) sintab)
sin8s_gen: {
.label step = $f
.label sintab = 5
@ -9073,6 +9106,7 @@ sin8s_gen: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($13) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -9271,6 +9305,7 @@ sin8s: {
//SEG437 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($1b) select)
mulu8_sel: {
.label _0 = $13
.label _1 = $13
@ -9300,6 +9335,7 @@ mulu8_sel: {
}
//SEG448 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $15
.label res = $13

View File

@ -22,6 +22,7 @@ main: {
// tabsize - the number of sinus points (the size of the table)
// min - the minimal value
// max - the maximal value
// sin8u_table(byte* zeropage(4) sintab)
sin8u_table: {
.const min = $a
.const max = $ff
@ -212,6 +213,7 @@ print_ln: {
rts
}
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label b = $a
lda b
@ -230,6 +232,7 @@ print_byte: {
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
@ -240,6 +243,7 @@ print_char: {
rts
}
// Print a zero-terminated string
// print_str(byte* zeropage($b) str)
print_str: {
.label str = $b
b1:
@ -263,6 +267,7 @@ print_str: {
jmp b1
}
// Print a signed word as HEX
// print_sword(signed word zeropage($b) w)
print_sword: {
.label w = $b
lda w+1
@ -283,6 +288,7 @@ print_sword: {
rts
}
// Print a word as HEX
// print_word(word zeropage($b) w)
print_word: {
.label w = $b
lda w+1
@ -294,6 +300,7 @@ print_word: {
rts
}
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage($a) b)
print_sbyte: {
.label b = $a
lda b
@ -315,6 +322,7 @@ print_sbyte: {
}
// Multiply a signed byte and an unsigned byte (into a signed word)
// Fixes offsets introduced by using unsigned multiplication
// mul8su(signed byte register(Y) a)
mul8su: {
.const b = sin8u_table.amplitude+1
.label m = $f
@ -333,6 +341,7 @@ mul8su: {
rts
}
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $b
.label res = $f
@ -369,6 +378,7 @@ mul8u: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($b) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -480,6 +490,7 @@ sin8s: {
}
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($11) select)
mulu8_sel: {
.label _0 = $f
.label _1 = $f
@ -510,6 +521,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4

View File

@ -3548,6 +3548,7 @@ main: {
// tabsize - the number of sinus points (the size of the table)
// min - the minimal value
// max - the maximal value
// sin8u_table(byte* zeropage(4) sintab)
sin8u_table: {
.const min = $a
.const max = $ff
@ -4000,6 +4001,7 @@ print_ln: {
}
//SEG171 print_byte
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label _0 = $3b
.label _2 = $3c
@ -4046,6 +4048,7 @@ print_byte: {
}
//SEG187 print_char
// Print a single char
// print_char(byte zeropage($b) ch)
print_char: {
.label ch = $b
//SEG188 [83] *((byte*) print_char_cursor#64) ← (byte) print_char::ch#5 -- _deref_pbuz1=vbuz2
@ -4065,6 +4068,7 @@ print_char: {
}
//SEG192 print_str
// Print a zero-terminated string
// print_str(byte* zeropage($c) str)
print_str: {
.label str = $c
//SEG193 [87] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -4106,6 +4110,7 @@ print_str: {
}
//SEG204 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage($e) w)
print_sword: {
.label w = $e
//SEG205 [93] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -4164,6 +4169,7 @@ print_sword: {
}
//SEG225 print_word
// Print a word as HEX
// print_word(word zeropage($12) w)
print_word: {
.label w = $12
//SEG226 [102] (byte) print_byte::b#1 ← > (word) print_word::w#3 -- vbuz1=_hi_vwuz2
@ -4195,6 +4201,7 @@ print_word: {
}
//SEG239 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage($14) b)
print_sbyte: {
.label b = $14
//SEG240 [107] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -4261,6 +4268,7 @@ print_sbyte: {
//SEG265 mul8su
// Multiply a signed byte and an unsigned byte (into a signed word)
// Fixes offsets introduced by using unsigned multiplication
// mul8su(signed byte zeropage($34) a)
mul8su: {
.const b = sin8u_table.amplitude+1
.label _5 = $3f
@ -4329,6 +4337,7 @@ mul8su: {
}
//SEG285 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte zeropage($18) a, byte zeropage($17) b)
mul8u: {
.label _1 = $42
.label mb = $1b
@ -4407,6 +4416,7 @@ mul8u: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($1e) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -4691,6 +4701,7 @@ sin8s: {
//SEG396 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte zeropage($22) v1, byte zeropage($23) v2, byte zeropage($24) select)
mulu8_sel: {
.label _0 = $54
.label _1 = $56
@ -4786,6 +4797,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage($27) dividend, word zeropage($25) rem)
divr16u: {
.label _1 = $5d
.label _2 = $5e
@ -5323,6 +5335,7 @@ main: {
// tabsize - the number of sinus points (the size of the table)
// min - the minimal value
// max - the maximal value
// sin8u_table(byte* zeropage(4) sintab)
sin8u_table: {
.const min = $a
.const max = $ff
@ -5750,6 +5763,7 @@ print_ln: {
}
//SEG171 print_byte
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label b = $a
//SEG172 [75] (byte~) print_byte::$0 ← (byte) print_byte::b#8 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuz1_ror_4
@ -5790,6 +5804,7 @@ print_byte: {
}
//SEG187 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG188 [83] *((byte*) print_char_cursor#64) ← (byte) print_char::ch#5 -- _deref_pbuz1=vbuaa
ldy #0
@ -5807,6 +5822,7 @@ print_char: {
}
//SEG192 print_str
// Print a zero-terminated string
// print_str(byte* zeropage($b) str)
print_str: {
.label str = $b
//SEG193 [87] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -5848,6 +5864,7 @@ print_str: {
}
//SEG204 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage($b) w)
print_sword: {
.label w = $b
//SEG205 [93] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -5901,6 +5918,7 @@ print_sword: {
}
//SEG225 print_word
// Print a word as HEX
// print_word(word zeropage($b) w)
print_word: {
.label w = $b
//SEG226 [102] (byte) print_byte::b#1 ← > (word) print_word::w#3 -- vbuz1=_hi_vwuz2
@ -5932,6 +5950,7 @@ print_word: {
}
//SEG239 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage($a) b)
print_sbyte: {
.label b = $a
//SEG240 [107] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -5994,6 +6013,7 @@ print_sbyte: {
//SEG265 mul8su
// Multiply a signed byte and an unsigned byte (into a signed word)
// Fixes offsets introduced by using unsigned multiplication
// mul8su(signed byte register(Y) a)
mul8su: {
.const b = sin8u_table.amplitude+1
.label m = $f
@ -6043,6 +6063,7 @@ mul8su: {
}
//SEG285 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $b
.label res = $f
@ -6115,6 +6136,7 @@ mul8u: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($b) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -6349,6 +6371,7 @@ sin8s: {
//SEG396 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($11) select)
mulu8_sel: {
.label _0 = $f
.label _1 = $f
@ -6411,6 +6434,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4
@ -6850,8 +6874,8 @@ Removing instruction lda #<0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [172] bcc b1 to bcs
Fixing long branch [178] bcc b1 to bcs
Fixing long branch [173] bcc b1 to bcs
Fixing long branch [179] bcc b1 to bcs
FINAL SYMBOL TABLE
(label) @41
@ -7276,6 +7300,7 @@ main: {
// tabsize - the number of sinus points (the size of the table)
// min - the minimal value
// max - the maximal value
// sin8u_table(byte* zeropage(4) sintab)
sin8u_table: {
.const min = $a
.const max = $ff
@ -7618,6 +7643,7 @@ print_ln: {
}
//SEG171 print_byte
// Print a byte as HEX
// print_byte(byte zeropage($a) b)
print_byte: {
.label b = $a
//SEG172 [75] (byte~) print_byte::$0 ← (byte) print_byte::b#8 >> (byte/signed byte/word/signed word/dword/signed dword) 4 -- vbuaa=vbuz1_ror_4
@ -7652,6 +7678,7 @@ print_byte: {
}
//SEG187 print_char
// Print a single char
// print_char(byte register(A) ch)
print_char: {
//SEG188 [83] *((byte*) print_char_cursor#64) ← (byte) print_char::ch#5 -- _deref_pbuz1=vbuaa
ldy #0
@ -7667,6 +7694,7 @@ print_char: {
}
//SEG192 print_str
// Print a zero-terminated string
// print_str(byte* zeropage($b) str)
print_str: {
.label str = $b
//SEG193 [87] phi from print_str print_str::@2 to print_str::@1 [phi:print_str/print_str::@2->print_str::@1]
@ -7702,6 +7730,7 @@ print_str: {
}
//SEG204 print_sword
// Print a signed word as HEX
// print_sword(signed word zeropage($b) w)
print_sword: {
.label w = $b
//SEG205 [93] if((signed word) print_sword::w#1>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sword::@1 -- vwsz1_ge_0_then_la1
@ -7743,6 +7772,7 @@ print_sword: {
}
//SEG225 print_word
// Print a word as HEX
// print_word(word zeropage($b) w)
print_word: {
.label w = $b
//SEG226 [102] (byte) print_byte::b#1 ← > (word) print_word::w#3 -- vbuz1=_hi_vwuz2
@ -7768,6 +7798,7 @@ print_word: {
}
//SEG239 print_sbyte
// Print a signed byte as HEX
// print_sbyte(signed byte zeropage($a) b)
print_sbyte: {
.label b = $a
//SEG240 [107] if((signed byte) print_sbyte::b#1<(byte/signed byte/word/signed word/dword/signed dword) 0) goto print_sbyte::@1 -- vbsz1_lt_0_then_la1
@ -7815,6 +7846,7 @@ print_sbyte: {
//SEG265 mul8su
// Multiply a signed byte and an unsigned byte (into a signed word)
// Fixes offsets introduced by using unsigned multiplication
// mul8su(signed byte register(Y) a)
mul8su: {
.const b = sin8u_table.amplitude+1
.label m = $f
@ -7853,6 +7885,7 @@ mul8su: {
}
//SEG285 mul8u
// Perform binary multiplication of two unsigned 8-bit bytes into a 16-bit unsigned word
// mul8u(byte register(X) a, byte register(A) b)
mul8u: {
.label mb = $b
.label res = $f
@ -7913,6 +7946,7 @@ mul8u: {
// Calculate signed byte sinus sin(x)
// x: unsigned word input u[4.12] in the interval $0000 - PI2_u4f12
// result: signed byte sin(x) s[0.7] - using the full range -$7f - $7f
// sin8s(word zeropage($b) x)
sin8s: {
// u[2.6] x^3
.const DIV_6 = $2b
@ -8111,6 +8145,7 @@ sin8s: {
//SEG396 mulu8_sel
// Calculate val*val for two unsigned byte values - the result is 8 selected bits of the 16-bit result.
// The select parameter indicates how many of the highest bits of the 16-bit result to skip
// mulu8_sel(byte register(X) v1, byte register(Y) v2, byte zeropage($11) select)
mulu8_sel: {
.label _0 = $f
.label _1 = $f
@ -8163,6 +8198,7 @@ div16u: {
// Returns the quotient dividend/divisor.
// The final remainder will be set into the global variable rem16u
// Implemented using simple binary division
// divr16u(word zeropage(4) dividend, word zeropage(2) rem)
divr16u: {
.label rem = 2
.label dividend = 4

View File

@ -25,6 +25,7 @@ main: {
sta screen
rts
}
// sum(byte register(Y) a, byte register(A) b)
sum: {
sty $ff
clc

View File

@ -384,6 +384,7 @@ main: {
rts
}
//SEG37 sum
// sum(byte zeropage(2) a, byte zeropage(3) b)
sum: {
.label return = 4
.label return_1 = 6
@ -534,6 +535,7 @@ main: {
rts
}
//SEG37 sum
// sum(byte register(Y) a, byte register(A) b)
sum: {
//SEG38 [19] (byte) sum::return#3 ← (byte) sum::a#3 + (byte) sum::b#3 -- vbuaa=vbuyy_plus_vbuaa
sty $ff
@ -689,6 +691,7 @@ main: {
rts
}
//SEG37 sum
// sum(byte register(Y) a, byte register(A) b)
sum: {
//SEG38 [19] (byte) sum::return#3 ← (byte) sum::a#3 + (byte) sum::b#3 -- vbuaa=vbuyy_plus_vbuaa
sty $ff

View File

@ -36,6 +36,7 @@ main: {
sta SCREEN+2
rts
}
// setByte(byte* zeropage(2) ptr, byte register(X) b)
setByte: {
.label ptr = 2
txa

View File

@ -334,6 +334,7 @@ main: {
rts
}
//SEG35 setByte
// setByte(byte* zeropage(3) ptr, byte zeropage(2) b)
setByte: {
.label b = 2
.label ptr = 3
@ -477,6 +478,7 @@ main: {
rts
}
//SEG35 setByte
// setByte(byte* zeropage(2) ptr, byte register(X) b)
setByte: {
.label ptr = 2
//SEG36 [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 -- _deref_pbuz1=vbuxx
@ -632,6 +634,7 @@ main: {
rts
}
//SEG35 setByte
// setByte(byte* zeropage(2) ptr, byte register(X) b)
setByte: {
.label ptr = 2
//SEG36 [17] *((byte*) setByte::ptr#3) ← (byte) setByte::b#3 -- _deref_pbuz1=vbuxx

View File

@ -28,6 +28,7 @@ main: {
* b - the second byte
* Returns the sum pf the two bytes
*/
// sum(byte register(Y) b)
sum: {
tya
clc

View File

@ -323,6 +323,7 @@ main: {
* b - the second byte
* Returns the sum pf the two bytes
*/
// sum(byte zeropage(4) b)
sum: {
.label b = 4
.label return = 5
@ -438,6 +439,7 @@ main: {
* b - the second byte
* Returns the sum pf the two bytes
*/
// sum(byte register(Y) b)
sum: {
//SEG30 [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuyy
tya
@ -579,6 +581,7 @@ main: {
* b - the second byte
* Returns the sum pf the two bytes
*/
// sum(byte register(Y) b)
sum: {
//SEG30 [15] (byte) sum::return#1 ← (const byte) a#0 + (byte) sum::b#0 -- vbuaa=vbuc1_plus_vbuyy
tya

Some files were not shown because too many files have changed in this diff Show More