Skip to content

Commit

Permalink
Ajout de la commande LOCATE pour positionner le curseur à l'écran du …
Browse files Browse the repository at this point in the history
…terminal, V1.0R6
  • Loading branch information
Picatout committed Jul 22, 2023
1 parent 83e7f86 commit 76c89d8
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 241 deletions.
5 changes: 5 additions & 0 deletions app_macros.inc
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,9 @@
.macro _cp_op
cp a,[psp]
.endm

; drop last pushed op
.macro _drop_op
_incz psp+1
.endm
Binary file modified build/stm8s207k8/pomme_1.bin
Binary file not shown.
483 changes: 243 additions & 240 deletions build/stm8s207k8/pomme_1.ihx

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions code_address.asm
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,5 @@ code_addr:
_code_entry cmd_erase, ERASE_IDX
_code_entry cmd_randomize, RNDMIZE_IDX
_code_entry cmd_cls, CLS_IDX
_code_entry cmd_locate,LOCATE_IDX
CMD_LAST=TOK_IDX-1
2 changes: 2 additions & 0 deletions journal.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### 2023-07-21

* Ajout de la commande **LOCATE ligne, colonne** pour positionner le curseur.

* Retravailler le décompilateur pour supprimer les espaces inutiles entre les unités lexicales.

* Ajouter un message de copyright au moniteur.
Expand Down
45 changes: 44 additions & 1 deletion p1Basic.asm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ free_ram:
;-----------------------
PB_MAJOR=1
PB_MINOR=0
PB_REV=5
PB_REV=6
app_name: .asciz "pomme BASIC\n"
pb_copyright: .asciz "Copyright, Jacques Deschenes 2023\n"
Expand Down Expand Up @@ -4055,6 +4055,48 @@ cmd_cls:
call clr_screen
_next

;-----------------------------
; BASIC: LOCATE line, column
; set terminal cursor position
;------------------------------
COL=1
LN=COL+INT_SIZE
cmd_locate:
call arg_list
cp a,#2
jreq 1$
jp syntax_error
1$:
ld a,#27
call uart_putc
ld a,#'[
call uart_putc
_i16_fetch LN
ld a,#255
call itoa
ld a,(x)
call uart_putc
ld a,(1,x)
cp a,#SPACE
jreq 2$
call uart_putc
2$: ld a,#';
call uart_putc
_i16_fetch COL
ld a,#255
call itoa
ld a,(x)
call uart_putc
ld a,(1,x)
cp a,#SPACE
jreq 3$
call uart_putc
3$: ld a,#'H
call uart_putc
_drop 2*INT_SIZE
_next


;------------------------------
; dictionary
; format:
Expand Down Expand Up @@ -4101,6 +4143,7 @@ dict_end:
_dict_entry,4,"NEXT",NEXT_IDX
_dict_entry,3,"MOD",MOD_IDX
_dict_entry,5,"LOMEM",LOMEM_IDX
_dict_entry,6,"LOCATE",LOCATE_IDX
_dict_entry,4,"LOAD",LOAD_IDX
_dict_entry 4,"LIST",LIST_IDX
_dict_entry 3,"LET",LET_IDX
Expand Down

0 comments on commit 76c89d8

Please sign in to comment.