Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
fps/fpo: push/pop conditional register.
Browse files Browse the repository at this point in the history
  • Loading branch information
kspalaiologos committed Sep 24, 2020
1 parent 5732f58 commit d4d8511
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 135 deletions.
6 changes: 4 additions & 2 deletions bfasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <stdio.h>
#include <stdlib.h>

#define IC 118
#define IC 120

/* db command location: instruction count - 4 */
#define C1 (IC-4)
Expand Down Expand Up @@ -75,7 +75,7 @@ int bfasm(void) {
#endif
unsigned int n;
char * s = "addanddecdiveq_ge_gt_in_incjmpjnzjz_lblle_lt_modmovmulne_negnotor_outpoppshrclstosubswpclrretendlogaslasrpowsrvampsmpnavceqcneclecltcgecgtcjncjzcadcsucmucdicmdcslcsrcpwcpscpocswcrvcmocrccstcamcsmx00x01x02x03x04shrshlcoucincpapargcdcgccrefmufdifrefadfsudupcdp"
"x05x06x07x08x09x0ax0bx0cx0dx0ex0fx10x11x12x13x14x15x16otscotdscsgtsptsletps"
"x05x06x07x08x09x0ax0bx0cx0dx0ex0fx10x11x12x13x14x15x16otscotdscsgtsptsletpsfpsfpo"
"rsestkorgdb_txtrawseg"
#ifndef BFVM
"a+b+[<[>-]>[>]<\0" /* 0 first */
Expand Down Expand Up @@ -261,6 +261,8 @@ int bfasm(void) {
"2-[p+#>[>>]+<<-<<[<<]>2-]+p[2+p-]#>[>>]<[-]<[<<]>1[p+#>[>>]<+<[<<]>1-]p[1+p-]#>[>>]>>[-<<+>>>>]<<<<[<<]>\0" /* spt */
"2[-]#>[>>]<<<<[>>[<<+>>-]+<<<<]>>[<2+#>-]+<\0" /* sle */
"1-[p+#>[>>]+<<-<<[<<]>1-]+p[1+p-]#>[>>]<[-]<[<<]>2[p+#>[>>]<+<[<<]>2-]p[2+p-]#>[>>]>>[-<<+>>>>]<<<<[<<]>\0" /* tps */
"q[p+#>[>>]>+<<<[<<]>q-]p[q+p-]#>[>>]+[<<]>\0" /* fps */
"q[-]#>[>>]<<->[<<<[<<]>q+#>[>>]>-]<<<[<<]>\0" /* fpo */
;
for (n = 0; n < 8000; n++) m[n + 20] = s[n];
m[6] = 0;
Expand Down
133 changes: 0 additions & 133 deletions hla/hla-test

This file was deleted.

9 changes: 9 additions & 0 deletions test/fps-fpo.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

mov r1, 6
cge r1, 3
fps
mov r1, 7
cge r1, 8
cout .0
fpo
cout .1
1 change: 1 addition & 0 deletions test/fps-fpo.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions test/fps-fpo.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1

0 comments on commit d4d8511

Please sign in to comment.