From 97aaffd166cd3ee6b68514aa49f603d523c788ce Mon Sep 17 00:00:00 2001 From: Max Wash Date: Fri, 13 Dec 2024 12:26:53 +0000 Subject: [PATCH] doc: update assembly language syntax --- doc/sample/Data.iasm | 36 +++++++++++++ doc/sample/Person.iasm | 115 +++++++++++++++++++++++------------------ 2 files changed, 102 insertions(+), 49 deletions(-) create mode 100644 doc/sample/Data.iasm diff --git a/doc/sample/Data.iasm b/doc/sample/Data.iasm new file mode 100644 index 0000000..53336c3 --- /dev/null +++ b/doc/sample/Data.iasm @@ -0,0 +1,36 @@ +@constpool + #0: "Received " + #1: ", " + #2: @ident(cout) + #3: @selector(-put:) + #4: @atom(years) + #5: @atom(months) + #6: @atom(days) + #7: @ident(_.Person_exampleProperty_get) + #8: @ident(_.Person_exampleProperty_set) + #9: @ident(_.Person_exampleProperty3_get) + #10: @ident(_.Person_exampleProperty3_set) + #11: @ident(_.Person_exampleProperty4_get) + #12: #42 + #13: @ident(net.doorstuck.test.Person) + #13: @ident(net.doorstuck.test.Vehicle) + #14: @selector(-init(name:age:)) + #15: @selector(-test(param:_:)) + #16: @selector(-name) + #17: @selector(-age) + #18: @selector(-ageInMonths) + #19: @selector(-setName:) + #20: @selector(-setAge:) + #21: @selector(-setAge:inUnits:) + #22: @selector(-getAgeInUnits:) + #23: @ident(std.io) + #24: @ident(exampleProperty) + #25: @ident(exampleProperty2) + #26: @ident(exampleProperty3) + #27: @ident(exampleProperty4) + #28: @ident(name) + #29: @ident(age) + #30: @ident(val) + #31: @ident(__exampleProperty3) + #32: @ident(__exampleProperty4) +@end \ No newline at end of file diff --git a/doc/sample/Person.iasm b/doc/sample/Person.iasm index 000fa3b..e9a7274 100644 --- a/doc/sample/Person.iasm +++ b/doc/sample/Person.iasm @@ -1,79 +1,96 @@ @constpool #0: "Received " #1: ", " - #2: @ident[cout] - #3: @selector[-put:] - #4: @atom[years] - #5: @atom[months] - #6: @atom[days] - #7: @ident[_.Person_exampleProperty_get] - #8: @ident[_.Person_exampleProperty_set] - #9: @ident[_.Person_exampleProperty3_get] - #10: @ident[_.Person_exampleProperty3_set] - #11: @ident[_.Person_exampleProperty4_get] + #2: @ident(cout) + #3: @selector(-put:) + #4: @atom(years) + #5: @atom(months) + #6: @atom(days) + #7: @ident(_.Person_exampleProperty_get) + #8: @ident(_.Person_exampleProperty_set) + #9: @ident(_.Person_exampleProperty3_get) + #10: @ident(_.Person_exampleProperty3_set) + #11: @ident(_.Person_exampleProperty4_get) #12: #42 - #13: @ident[#13] - #14: @selector[-init(name:age:)] - #15: @selector[-test(param:_:)] - #16: @selector[-name] - #17: @selector[-age] - #18: @selector[-ageInMonths] - #19: @selector[-setName:] - #20: @selector[-setAge:] - #21: @selector[-setAge:inUnits:] - #22: @selector[-getAgeInUnits:] - #23: @ident[std.io] - #24: @ident[exampleProperty] - #25: @ident[exampleProperty2] - #26: @ident[exampleProperty3] - #27: @ident[exampleProperty4] + #13: @ident(net.doorstuck.test.Person) + #14: @selector(-init(name:age:)) + #15: @selector(-test(param:_:)) + #16: @selector(-name) + #17: @selector(-age) + #18: @selector(-ageInMonths) + #19: @selector(-setName:) + #20: @selector(-setAge:) + #21: @selector(-setAge:inUnits:) + #22: @selector(-getAgeInUnits:) + #23: @ident(std.io) + #24: @ident(exampleProperty) + #25: @ident(exampleProperty2) + #26: @ident(exampleProperty3) + #27: @ident(exampleProperty4) + #28: @ident(name) + #29: @ident(age) + #30: @ident(val) + #31: @ident(__exampleProperty3) + #32: @ident(__exampleProperty4) @end -@import [package:#23] +@import + @package[ident:#23] +@end -@lambda [ident:#7] +@block [index:#1009] ldr x0, [self, #2] ret @end -@lambda [ident:#8] +@block [index:#1010] ldr x0, [bp, #-1] str x0, [self, #2] ret @end -@lambda [ident:#9] +@block [index:#1011] ldr x0, [self, #3] ret @end -@lambda [ident:#10] +@block [index:#1012] ldr x0, [bp, #-1] str x0, [self, #3] ret @end -@lambda [ident:#11] +@block [index:#1013] ldr x0, [self, #4] ret @end @class [ident:#13] - @property[ident:#24 get:#7 set:#8] - @property[ident:#25 get:#12] - @property[ident:#26 set:#10] - @property[ident:#27 get:#11] + @property[ident:#24 get:#1009 set:#1010] + @property[ident:#25 get:#1013] + @property[ident:#26 set:#1011] + @property[ident:#27 get:#1012] - #0: name - #1: age - #2: val - #3: __exampleProperty3 - #4: __exampleProperty4 + @var[index:#0 ident:#28] + @var[index:#1 ident:#29] + @var[index:#2 ident:#30] + @var[index:#3 ident:#31] + @var[index:#4 ident:#32] + + @msgh[selector:#14 block:#1000] + @msgh[selector:#15 block:#1001] + @msgh[selector:#16 block:#1002] + @msgh[selector:#17 block:#1003] + @msgh[selector:#18 block:#1004] + @msgh[selector:#19 block:#1005] + @msgh[selector:#20 block:#1006] + @msgh[selector:#21 block:#1007] + @msgh[selector:#22 block:#1008] @end -@msgh [recipient:#13 selector:#14] +@block [index:#1000] ldr x0, [bp, #-1] str x0, [self, #0] @@ -83,7 +100,7 @@ ret.n @end -@msgh [recipient:#13 selector:#15] +@msgh [index:#1001] ldr x0, [pool, #0] ldr x1, [bp, #-1] @@ -105,17 +122,17 @@ ret.n @end -@msgh [recipient:#13 selector:#16] +@msgh [index:#1002] ldr x0, [self, #0] ret @end -@msgh [recipient:#13 selector:#17] +@msgh [index:#1003] ldr x0, [self, #1] ret @end -@msgh [recipient:#13 selector:#18] +@msgh [index:#1004] ldr x0, [self, #1] ldr x1, #12 @@ -124,21 +141,21 @@ ret @end -@msgh [recipient:#13 selector:#19] +@msgh [index:#1005] ldr x0, [bp, #-1] str x0, [self, #0] ret.n @end -@msgh [recipient:#13 selector:#20] +@msgh [index:#1006] ldr x0, [bp, #-1] str x0, [self, #1] ret.n @end -@msgh [recipient:#13 selector:#21] +@msgh [index:#1007] ldr x0, [bp, #-1] ldr x1, [bp, #-2] @@ -175,7 +192,7 @@ L0004: ret.n @end -@msgh [recipient:#13 selector:#22] +@msgh [index:#1008] ldr x1, [bp, #-1] ; x1 = units ldr x2, [pool, #4] ; x2 = #years