#emit Discussion
#3

Hm, I didn't even consider emitting labels possible, but it almost works:
Quote:

CODE 0 ; 0
;program exit point
halt 0

proc ; main
; line 1
break ; c
; line 2
break ; 10
push.c 0
call .Hello
;$exp
zero.pri
retn

proc ; Hello
; line 6
break ; 30
; line 7
break ; 34
;$lcl pos fffffffc
stack fffffffc
zero.pri
stor.s.pri fffffffc
;$exp
;$lcl cmdtext fffffff8
stack fffffffc
zero.pri
stor.s.pri fffffff8
;$exp

inc fffffffc
load.pri fffffffc
load.s.alt fffffff8
lidx
eq.c.pri 14
jzer 10
jump f
l. 10
load.s.alt fffffff8
load.pri fffffffc
idxaddr
; line 18
break ; b4
const.pri 1
stack 8
retn


DATA 0 ; 0
dump 6c 2e 31 35 0

STKSIZE 1000

As you can see, for some reason it almost works, but adds space before number. I wouldn't work with this. From quick analysis of YSI I see JUMP.rel and JZER.rel is more flexible approach. Also, unless you want to use pure Pcode, you can just write it as

pawn Код:
new tmp;

do {
    #emit INC pos
    #emit LOAD.pri pos
    #emit LOAD.S.alt cmdtext
    #emit LIDX
    #emit STOR.S.pri tmp
} while (20 != tmp);

#emit LOAD.S.alt cmdtext
#emit LOAD.pri pos
#emit IDXADDR
Reply


Messages In This Thread
#emit Discussion - by Yashas - 20.06.2015, 18:47
Re: #emit Discussion - by ]Rafaellos[ - 20.06.2015, 19:08
Re: #emit Discussion - by Misiur - 20.06.2015, 21:18
Re: #emit Discussion - by Yashas - 21.06.2015, 04:38
Re: #emit Discussion - by Misiur - 21.06.2015, 07:50
Re: #emit Discussion - by Yashas - 21.06.2015, 08:48
Re: #emit Discussion - by PeterJane - 25.06.2015, 00:29
Re: #emit Discussion - by Yashas - 12.07.2015, 07:56
Re: #emit Discussion - by Vince - 12.07.2015, 10:46
Re: #emit Discussion - by Yashas - 12.07.2015, 10:54
Re: #emit Discussion - by Yashas - 31.08.2015, 15:46
Re : #emit Discussion - by Dutheil - 10.11.2015, 23:04
Re: #emit Discussion - by Yashas - 11.11.2015, 13:09
Re: #emit Discussion - by Dutheil - 18.07.2017, 14:26
Re: #emit Discussion - by Nero_3D - 18.07.2017, 23:47
Re: #emit Discussion - by Dutheil - 19.07.2017, 00:31
Re: #emit Discussion - by Nero_3D - 19.07.2017, 22:07
Re: #emit Discussion - by Dutheil - 29.12.2017, 14:45
Re: #emit Discussion - by Misiur - 29.12.2017, 15:24
Re: #emit Discussion - by Kaperstone - 29.12.2017, 15:49
Re: #emit Discussion - by Y_Less - 29.12.2017, 16:00
Re: #emit Discussion - by Dutheil - 29.12.2017, 19:56

Forum Jump:


Users browsing this thread: 1 Guest(s)