File tree Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Original file line number Diff line number Diff line change @@ -371,7 +371,6 @@ const instructions = struct {
371
371
const src = cpu .regs [info .d .num ()];
372
372
373
373
const res = src -% 1 ;
374
-
375
374
cpu .regs [info .d .num ()] = res ;
376
375
377
376
cpu .sreg .z = (res == 0 );
@@ -387,6 +386,7 @@ const instructions = struct {
387
386
const Rr : Bits8 = @bitCast (rhs );
388
387
389
388
const res : u8 = lhs +% rhs +% @intFromBool (c );
389
+ cpu .regs [info .d .num ()] = res ;
390
390
391
391
const R : Bits8 = @bitCast (res );
392
392
Original file line number Diff line number Diff line change
1
+ //! {
2
+ //! "exit_code" : 0 ,
3
+ //! "stdout" : "" ,
4
+ //! "stderr" : "Hi"
5
+ //! }
6
+
7
+ #include "../regs.inc"
8
+
9
+ . global _start
10
+ _start:
11
+
12
+ ; '\' + '!' = 'H'
13
+ ldi r16 , '\' '
14
+ ldi r18 , '!'
15
+ add r16 , r18
16
+ out IO_STDERR , r16
17
+ ldi r16 , 0x80
18
+ ldi r18 , 0x80
19
+ add r16 , r18
20
+ ; '4' + '4' + carry = 'i'
21
+ ldi r17 , '4'
22
+ ldi r19 , '4'
23
+ adc r17 , r19
24
+ out IO_STDERR , r17
25
+
26
+ clr r16
27
+ out IO_EXIT , r16
Original file line number Diff line number Diff line change
1
+ //! {
2
+ //! "exit_code" : 0 ,
3
+ //! "stdout" : "" ,
4
+ //! "stderr" : "Hi"
5
+ //! }
6
+
7
+ #include "../regs.inc"
8
+
9
+ . global _start
10
+ _start:
11
+
12
+ ; 'q' - ')' = 'H'
13
+ ldi r16 , 'q'
14
+ ldi r18 , ')'
15
+ sub r16 , r18
16
+ out IO_STDERR , r16
17
+ ldi r16 , 0x80
18
+ ldi r18 , 0x80
19
+ add r16 , r18
20
+ ; '~' - 0x14 - carry = 'i'
21
+ ldi r17 , '~'
22
+ ldi r19 , 0x14
23
+ sbc r17 , r19
24
+ out IO_STDERR , r17
25
+
26
+ clr r16
27
+ out IO_EXIT , r16
You can’t perform that action at this time.
0 commit comments