questo sarebbe un linguaggio "brainfuck"
; u32 __stdcall SpedisciNomeEdopoFile(u32* socket, u32 iFinestraHandle, u8*
StringNameFile)
; Anche se "StringNameFile" è un percorso, spedisce soltanto il nome finale del
file.
; aspetta un secondo per permettere al client di aprire il file in scrittura, e
lo spedisce.
; Se errori di parametro o non identif. ritorna 1 CF=1
; Se il nome è troppo lungo ritorna 2 CF=1
; Se il file non si apre ritorna 3 CF=1
; Se la spedizione nome non riuscita ritorna 4 CF=1
; Se qualcosa spedizione non ok ritorna 5 CF=1
; se tutto ok ritorna 0 CF=0
; USATI gli indirizzi per la finestra, ma anche la variabile random GLOBALE
; 0k,4j,8i,12b,16Ra, 20P_Socket, 24P_ifinestra, 32P_buf_string +2048
; 2068 2072 2076
align 4
SpedisciNomeEdopoFile:
<b,i,j,k
s-=2048
^16=1 ; in 16 ci metto quello che esce in caso di errore [1== errore di
parametro]
^20=0 ; in 20 ci metto 'C' se la trasmissione è criptata, altrimenti 0
^24=0 ; in 24 la lunghezza della stringa in buf e sua traduzione senza
path
^28=0 ; in 28 il Pfile del file da spedire
^32=0 ; in 32 i bytes inviati
; in 100..200 il nome senza path da inviare
i=^2072|i== -1#.e ; ifinestra [out]
j=^2068|j== 0#.e3 ; Psoket [out]
b=^2076|b== 0#.e3 ; buffer [in ]
#.0
.e1: PostMessage(i, &WM_COMMAND, 1036, "Errore: file da spedire non
trovato")|#.e
.e2: PostMessage(i, &WM_COMMAND, 1036, "Errore: spedizione non completamente
riscita")|#.e
.e3: PostMessage(i, &WM_COMMAND, 1036, "Errore di spedizione non
identificato")|#.e
.e4: a=^28|Fclose_m(a)
.e44: PostMessage(i, &WM_COMMAND, 1036, "Errore: nome del file troppo
lungo")|#.e
.e5: a=^28|Fclose_m(a)
.e6: PostMessage(i, &WM_COMMAND, 1036, "Errore: spedizione del file non
riuscita")|#.e
.e: a=^16|stc|#.z
.0: a=&^100|GetDlgItemTextA(i, MD_ED_CRPVEDERE, a, 2)|a==0#.1 ; ==0 significa:
non crpt
a=&^100|c^=c|cl=B*a|c!="C"#.1|^20=c ; se in ^20 non C => non è criptata
.1: PostMessage(i, &WM_COMMAND, 1036, "aspetta la scrittura del file" )
a^=a|c^=c
^16=2 ; 2== nome file troppo lungo
.11: al=*b+c|a==0#.12|++c|c>200#.e44|#.11
.12: ^24=c ; in 24 la lunghezza della stringa in buf
^16=3|a=s|D*a="r"|Fopen_m(b,a)|jc .e1|^28=a
k=&^101|EstraiNomeFinaleDalPath(k, 100, b)|jc .e4|a<0?#.e4|a>200#.e4
^24=a ; in ^24 la lunghezza del nome del file da inviare
--k ; punta a s+100
*k=al ; ove inserire la lunghezza della stringa da inviare all'inizio
^20=="C"!#.13
c=*PmemRndu|CriptArrRNDXorTable(k, 1, CrpTable, c) ; cripta
la dimensione
++k|a=^24|c=*PmemRndu|CriptArrRNDXorTable(k, a, CrpTable, c) ; cripta
il nome
.13: ^4=0|j+=20|--k ; j indirizzo di socket out
BloccaRisorsaSys(UsoSocket)
; spedisce il nome del file+\0 eventualmente criptato, tutto non
bufferizzato
^16=4|r=s| Scrivi(j,r, k,1)|^4++=0|jnz .1z ; spedisce la dimensione
++k |r=s|c=^24|Scrivi(j,r, k,c)|^4++=0|jnz .1z ; spedisce il nome
Sleep(1000) ; aspetta che il client apri il file e sia pronto per la
ricezione
^16=5|r=^28|^20=="C"!#.14 ; spedisce il file
c=*PmemRndu|CriptFileRNDXorTable(j, r, CrpTable, c)|^32=a|^4++=0|#.1z
.14: CopiaFile(j,r)|^32=a|^4++=0
.1z: LiberaRisorsaSys(UsoSocket)
^4#.e5 ; errori di spedizione
a=^28|Fclose_m(a)|jc .e6 ; in ^0 vi sono i bytes inviati del nome
c=^0 |c+=^32 |++c|jz .e3 ; Spedisce Nbytes+1 perchè 0 non puo' essere
spedito
.2: PostMessage(i, &WM_COMMAND, MD_PSEUDO_BUTTON_BYTES_INVIATI, c )
PostMessage(i, &WM_COMMAND, 1036,"scrittura del file completata: tutto
ok" )
.9: a^=a
.z:
s=&*s+2048
>b,i,j,k
ret 12
ok potrebbe essere piena di errori, ok;
potrebbe essere progettata male (probabilmente per spedire il file dovevo
aprire un'altra porta diversa da quella della connessione principale)
ma
se io dovessi riscrivere nei vostri linguaggi, C C++, o plain-asm
quello che fa questa routine,
(condizioni di errore e preservare l'algoritmo)
per me, al più, si potrebbe ottenere una routine 3x volte più lunga e
50x volte più difficile da leggere.
oppure 3 routines della stessa linghezza ma 10 volte piu' difficili
da leggere ciscuna.
Sottolineo che questo significa che il linguaggio "brainfuck" non lo è
oppure lo è assai meno dei linguaggi plain asm, C, C++.
in altre parole sembra che l'estrema libertà di usare piccole [poche]
istruzioni,
e di disporle nella pagina
ed di usare lo stack renda, tutto piu' semplice, perchè vengono
buone idee l'una dopo l'altra
Scusate se sono stato troppo duro-rude.
Ciao
Buona Giornata
mi sono accorto di un errore
qui ci doveva essere
"--k"
> .13: ^4=0|j+=20|--k ; j indirizzo di socket out
^^^^
e questo doveva essere cancellato
tu non sei poco rude, sei *rudisimo*:
Si prega di trovare un molo corto e fare una lunga passeggiata
That's nothing to do with brainfuck (AFAICS) which looks like the examples
here:
http://en.wikipedia.org/wiki/Brainfuck
Unless your code is supposed to be an implementation of it in some
mysterious language. In which case, I think I would rather program in
brainfuck...
...
> .z:
> s=&*s+2048
>>b,i,j,k
> ret 12
> ma
> se io dovessi riscrivere nei vostri linguaggi, C C++, o plain-asm
> quello che fa questa routine,
> (condizioni di errore e preservare l'algoritmo)
> per me, al piů, si potrebbe ottenere una routine 3x volte piů lunga e
> 50x volte piů difficile da leggere.
I think you mean 'piu facile'..
--
Bartc
i don't know it, very strange language :)
> ...
>> .z:
>> s=&*s+2048
>>>b,i,j,k
>> ret 12
>
>> ma
>> se io dovessi riscrivere nei vostri linguaggi, C C++, o plain-asm
>> quello che fa questa routine,
>> (condizioni di errore e preservare l'algoritmo)
>> per me, al piů, si potrebbe ottenere una routine 3x volte piů lunga e
>> 50x volte piů difficile da leggere.
>
> I think you mean 'piu facile'..
no, C,C++, plain asm, rewrite of that routine should be "piu' difficile"
for read
> --
> Bartc
How are you? here all well, if not consider Berlusconi and all
other in politician here in 30 year until now :)
do you know what is a 2^n len char buffer circular?
what for an implementation for append one answer in brainfuck ?
; u32 AppendBufCircular(i8* bufStart, i8* bufEnd, u32* IndexNow, u8*
array, u32 arrSz)
; Riempie un buffer circolare attraverso un indice, copiando da un array
;
; Tale buffer circolare deve avere size 2^n
; se non ha tale caratteristica la funzione ritorna errore
;
; in ogni caso termina l'array con zero
; ritorna il numero dei caratteri letti ritornato se tutto va bene e CF==0
; nel caso di errore ritorna -1 e CF==1
; Se tutto va bene in r ritorna il numero dei caratteri effettivamente scritti
; gli errori di parametro possono essere trovati solo in assembly
; poiche' in tal caso ritorna 0 CF==1
; 0k,4j,8i,12b,16Ra, 20P_buf, 24P_SzElm, 28P_nElm, 32P_pChar, 36P_sz +256
; 276 280 284 288 292
align 4
AppendBufCircular:
<b,c,j,k
s-=256
<< bufStart=276, BufEnd=280, IndexNow=284, pChar=288
<< ValMod =64, Nchars=68
j=^bufStart|c=^BufEnd|a=^IndexNow|b=^pChar
j==0#.e |c==0#.e |j>=c#.e|a==0#.e|^Nchars=0 ; numero caratteri
effettivamente scritti
k=*a ; k e' l'indice attuale
r=c|r-=j|--r|a=r|r&=0FFFFFFFFh|a!=r#.e ; BufEnd-Bufstart-1=..FF..
^ValMod=a|a<k#.e ; il valore massimo tipo
..FF..
c=^292|a^=a|c<0?#.e|=#.f|b#.1
.e: a=-1|r=-1|^IndexNow==0#.e1|c=^IndexNow|*c=k
.e1: stc|#.z
.1: k&=^ValMod
k==0#.1a|B*j+k-1==10#.1a
B*j+k=13|++k|++^Nchars|k&=^ValMod ; se non vi � \n allora appendi \n
B*j+k=10|++k|++^Nchars|k&=^ValMod
.1a: B*j+k='>'|++k|++^Nchars|k&=^ValMod ; aggiunge il pront di chi invia
B*j+k=' '|++k|++^Nchars|k&=^ValMod
.2: al=*b |*j+k=al
++b|jz .e|++k|js .e|++^Nchars|k&=^ValMod
a==10!#.2a
B*j+k='>'|++k|js .e|++^Nchars|k&=^ValMod
B*j+k=' '|++k|js .e|++^Nchars|k&=^ValMod
.2a: --c#.2
k==0#.f|B*j+k-1==10#.f
B*j+k=13|++k|++^Nchars|k&=^ValMod ; se non vi � \n allora appendi \n
B*j+k=10|++k|++^Nchars|k&=^ValMod
.f: b-=^pChar|a=b|r=^Nchars|B*j+k=0|c=^IndexNow|*c=k|clc
.z:
>> ValMod, Nchars
>> bufStart, BufEnd, IndexNow, pChar
s =&*s+256
>b,c,j,k
ret 20
there is a big buffer long 2^n for some n [index in 0..FF or 0..1FF etc]
the index is mod 2^n-1 so that buffer can not overflow because
index=index&(2^n-1)
it seems useful for human or slow input output without
programs can overflow it...
> ; gli errori di parametro possono essere trovati solo in assembly
> ; poiche' in tal caso ritorna 0 CF==1
the above 2 lines are not correct
> ; 0k,4j,8i,12b,16Ra, 20P_buf, 24P_SzElm, 28P_nElm, 32P_pChar, 36P_sz +256
> ; 276 280 284 288 292
> align 4
> AppendBufCircular:
> <b,c,j,k
> s-=256
> << bufStart=276, BufEnd=280, IndexNow=284, pChar=288
> << ValMod =64, Nchars=68
> j=^bufStart|c=^BufEnd|a=^IndexNow|b=^pChar
> j==0#.e |c==0#.e |j>=c#.e|a==0#.e|^Nchars=0 ; numero caratteri
> effettivamente scritti
> k=*a ; k e' l'indice attuale
> r=c|r-=j|--r|a=r|r&=0FFFFFFFFh|a!=r#.e ;
> BufEnd-Bufstart-1=..FF..
> ^ValMod=a|a<k#.e ; il valore massimo tipo
> ..FF..
> c=^292|a^=a|c<0?#.e|=#.f|b#.1
> .e: a=-1|r=-1|^IndexNow==0#.e1|c=^IndexNow|*c=k
> .e1: stc|#.z
> .1: k&=^ValMod
> k==0#.1a|B*j+k-1==10#.1a
> B*j+k=13|++k|++^Nchars|k&=^ValMod ; se non vi è \n allora appendi \n
> B*j+k=10|++k|++^Nchars|k&=^ValMod
> .1a: B*j+k='>'|++k|++^Nchars|k&=^ValMod ; aggiunge il pront di chi invia
> B*j+k=' '|++k|++^Nchars|k&=^ValMod
> .2: al=*b |*j+k=al
> ++b|jz .e|++k|js .e|++^Nchars|k&=^ValMod
> a==10!#.2a
> B*j+k='>'|++k|js .e|++^Nchars|k&=^ValMod
> B*j+k=' '|++k|js .e|++^Nchars|k&=^ValMod
> .2a: --c#.2
> k==0#.f|B*j+k-1==10#.f
> B*j+k=13|++k|++^Nchars|k&=^ValMod ; se non vi è \n allora appendi \n
Do you like my implementation of STL, vector like in asm? :)
Afther i wrote some routine i understood is better use
\0 terminated strings, and easier routines.
So i should not use the routines below in my hobby code.
Only one of these routine pass a full test
some other has some debug session for see if they are ok
some other only i write down whitout any run.
Do you like how i comment functions?
Are them with too few comments?
What about the library lay out?
to me it seems very good...
the first u32 for the space of the pointer
the sys use for the multithread
the other u32 one pointer to a struct
that define the array[or the list, or some other]...
Thank you
;;
Array dinamici
v:
0: u32 Riservato All'utente [per esempio per il multithread]
4: u32* PuntatoreAstructA
Size=8u8
Un array è lo spazio di memoria per 2 u32
inizialmente entrambi uguali a zero,
il primo non è usato [quindi chi lo usa potrebbe inventarsi
la ragione per usarlo], il secondo viene riempito da
un puntatore alla struttura di sotto.
structA:
objSz: u32 0 size di un elemento dell'array
nObj: u32 4 numero di oggetti allocati di dimensione objSz
iSup: u32 8 gli oggetti usati hanno indice 0..iSup-1
iSup==0 significa nessun elemento
arrv: u32* 12 array
SIZE==16u8
Un array nasce con la funzione ArrIni()
per aggiungere elementi si usa la funzione pushT() o pushH()
oppure una qualunque funzioni che permette l'inserimento
dall'indice <= iSup. Se l'indice è > iSup per la scrittura
ritorna errore. Se l'inice >= iSup per la lettura ritorna
errore.
Convenzioni linguistiche usate
Ogni spazio di memoria per noi piu' significativo,
è un numero, rappresentato da una macro semplice
(parola significativa associata a numero).
I registri sono nomi brevi familiari a noi che li
usiamo sempre: a,b,c,r,i,j,k,s e sempre gli stessi con
semplici operazioni tra essi e con la memoria
[=, |=,&=, ^=, *, operazioni jmp, &, <>[cmp],
-=, +=, ++=, --=, <<=, >>=, stc, clc, call, etc]
;;
; definisco macro associati a numeri significativi,
; per la piccola libreria sottostante: essi valgono per ciascuna
; funzione della libreria; quando le funzioni della libreria
; finiscono uso l'undef (>> ...) degli stessi.
<< objSz=0, nObj=4, iSup=8, arrv=12
; u32 ArrIni(u32** v, u32 objSz, u32 nObj)
; v e' puntatore a una regione di tipo dati di 2 u32
; entrambi zero alla prima chiamata,
; il primo non è usato [puo' essere usato da chi
; usa la libreria], il secondo viene riempito
; con un altro puntatore che punta alla struttura array di sopra.
; objSz è la dimensione di ciascun elemento da cui è formato l'array
; nObj è il numero di elementi di cui l'array ha memoria
; Esempio:
; u32 p[2]={0}; // non ho provato non so se potrebbe compilare
; ArrIni(p, 8, 3)
; *(p+4)+arrv punta ad un array di elementi 8_u8 che ha memoria
; per tre elementi. In pratica in ciascun elemento ci entrano
; 2 u32 anche.
; 0k,4j,8i,12b,16ra, 20P_list, 24P_objSz, 28P_nObj + 32
; 52b 56k 60j
align 4
ArrIni:
<b,i,j,k
s-=32
b=^52 |k=^56 |j=^60
b==0#.e|k<=0?#.e|j<0?#.e
#.1
.e0: Free_m(i)
.e: a=-1|stc|#.z
.1: a=k|mul j|r#.e|a<0?#.e|^0=a
Malloc_m(16) |a==0#.e|i=a
c=^0|a^=a|c==0#.2|Malloc_m(c)|a==0#.e0 ; alloca nObj
.2: *b+4=i|*i+objSz=k|*i+nObj=j|D*i+iSup=0|*i+arrv=a ; non esiste un massimo
indice
a^=a
.z:
s=&*s+32
>b,i,j,k
ret 12
;u32 ArrFree(u32** v)
;0j,4i,8ra, 12P_v
align 4
ArrFree:
<i,j
j=^12|j==0#.e|i=*j+4|i==0#.2|#.1
.e: a=-1|stc|#.z
.1: a=*i+arrv|Free_m(a)|jc .e
Free_m(i)|jc .e
D*j+4=0 ; l'elemento *j+0 non si tocca
.2: a^=a
.z:
>i,j
ret 4
; u32 ArrResize(u32** v, u32 SizeInNobj)
;0j,4i,8ra,12P_v, 16P_sizeInNobj
align 4
ArrResize:
<i,j
c=^12 |j=^16
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=-1|stc|#.z
.1: a=*i+objSz|mul j|r#.e|a<0?#.e
r=*i+arrv |Realloc_m(r, a)|a==0#.e
*i+arrv=a |*i+nObj=j
.2: *i+iSup>j!#.3
*i+iSup=j
.3: a^=a
.z:
>i,j
ret 8
;u32 ArrScrivi8(u32** v, u32 index, u32 elm8)
;la scrittura ha senzo solo in indici 0..iSup
;notare che iSup è l'unico indice in cui non si è scritto
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrScrivi8:
<i,j
c=^12|^20>0FFh#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup #.e ; puo' scrivere in 0..iSup
<#.2|j<*i+nObj#.2
++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j
.2: a=*i+objSz|mul j|r#.e|a<0?#.e
r=*i+arrv |c=^20
.3: a+=r|jc .e|*a=cl|clc
.z:
>i,j
ret 12
;u32 ArrScrivi16(u32** v, u32 index, u32 elm16)
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrScrivi16:
<i,j
c=^12|^20>0FFFFh#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup#.e
<#.2|j<*i+nObj#.2|++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
r=*i+arrv |c=^20
.3: a+=r|jc .e|*a=cx
.z:
>i,j
ret 12
;u32 ArrScrivi32(u32** v, u32 index, u32 elm32)
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrScrivi32:
<i,j
c=^12 |j=^16
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup#.e
<#.2|j<*i+nObj#.2|++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
r=*i+arrv |c=^20
.3: a+=r|jc .e|*a=c
.z:
>i,j
ret 12
;u32 ArrPScrivi(u32** v, u32 index, u8* Pelm)
;copia un elemento in "v", nell'indice "index", a partire da Pelm32
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrPScrivi:
<i,j
c=^12 |j=^16 |^20==0#.e
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup#.e
<#.2|j<*i+nObj#.2|++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
r=*i+arrv |c=^20 |r+=a
a=*i+objSz|MmrCpy(r,c,a)
; a CF settati da mmrcpy
.z:
>i,j
ret 12
; Ritorna a=iSup c=nObj del vettore CF==0
; Ritorna a=0 CF==1 se errore
; 0ra, 4P_v
align 4
ArriSupNobj:
a=^4|a==0#.e|c=*a+4|c==0#.e
a=*c+iSup|c=*c+nObj|clc ; a è lindice massimo attualmente usato
#.1
.e: a=0|stc
.1:
ret 4
; Ritorna (objSz, arrv, &strutturaArray) in (c,r,a) rispettivamente e CF==0
; se errore ritorna a=0 CF==1
; {NB attraverso 'a' possiamo accedere a tutti i valori della struttura del
vettore}
; 0ra, 4P_v
align 4
ArrInfo:
c=^4|c==0#.e|a=*c+4 |a==0#.e
c=*a+objSz |r=*a+arrv|clc
#.1
.e: a=0|stc
.1:
ret 4
; u32 ArrPushT(u32** v, u32* pelm)
; push in the tail
; 0ra,4P_v,8P_pelm
ArrPushT:
c=^4|ArriSupNobj(c)|jc .e
#.1
.e: a=0 |stc|#.z
.1: c=^4|r=^8|ArrPScrivi(c, a, r)
.z:
ret 8
;u32 ArrPInsert(u32** v, u32 index, u8* Pelm)
;se eventualmente presenti sposta di uno gli elementi index..iSup-1 in
index+1..iSup
;copia un elemento in "v", nell'indice "index", copia da Pelm32
;0k,4j,8i,12b,16ra, 20P_v, 24P_Index, 28P_elm
align 4
ArrPInsert:
<b,i,j,k
c=^20 |j=^24 |^28==0#.e
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: b=*i+arrv
k=*i+iSup|k<*i+nObj#.2
<c|++k|ArrResize(c, k)|>c|jc .e
.2: a=*i+objSz|mul j|r#.e|a<0?#.e|k=a ; b+k==&j j<=iSup
j<*i+iSup!#.6 ; sposta gli elementi di indice
j..iSup-1 -> j+1..iSup
c=*i+iSup |c-=j |<=?#.e
a=*i+objSz|mul c|r#.e |a<0?#.e|c=a
a=*i+objSz|a+=k |jc .e|a+=b|jc .e ; a=&j+1
r=&*b+k ; r=&j
MmrCpy(a,r,c)|jc .e
.6: c=^28|b+=k|jc .e|a=*i+objSz|MmrCpy(b,c,a)|jc .z ; errore di memcpy è
compatibile
++D*i+iSup
.7: clc ; a settato
.z:
>b,i,j,k
ret 12
; u32 ArrPushT(u32** v, u32* pelm)
; 0ra,4P_v,8P_pelm
ArrPushH: a=^4|c=^8|ArrPInsert(a, 0, c)|ret 8
;u32 ArrScriviNelm(u32** v, u32 index, u8* Pelm, u32 Nele)
;copia "Nele" in "v", nell'indice "index", a partire da Pelm32
;0k,4j,8i,12b,16ra, 20P_v, 24P_Index, 28P_pelm, 32P_Nele
align 4
ArrScriviNelm:
<b,i,j,k
c=^20 |j=^24 |^28==0#.e|k=^32
c==0#.e|i=*c+4|j<0?#.e| i==0#.e|k<0?#.e| =#.3
j>*i+iSup#.e ; je[0..iSup]
#.1
.e: a=-1| stc|#.z
.1: k+=j|jc .e| <=?#.e
k>=*i+nObj!#.2
ArrResize(c, k)|jc .e
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
b=*i+arrv |c=^28 |b+=a
k=^32|a=*i+objSz|mul k|r#.e|a<0?#.e
MmrCpy(b,c,a)|jc .e
j+=k
*i+iSup<j!#.3|*i+iSup=j
.3: a^=a
.z:
>b,i,j,k
ret 16
;u32 MmrCpy(u8* d, u8* o, u32 sz)
;ritorna 0 CF==1 per errore
;ritorna d CF==0 tutto ok con "d" l'array di partenza
;NB: è possibile che ci siano problemi se gli indirizzi dei
;caratteri degli array si sovrappongono
;ma non ho trovato bugs con semplici test di comparazione
;con memmove()... [è possibile che scriva u32 non allineati]
;0j,4i,8ra, 12P_d, 16P_o, 20P_sz
align 4
MmrCpy:
<i,j
j=^12 |i=^16 |r=^20 |c^=c ; j i
j==0#.e |i==0#.e|r<0?#.e| =#.5 ; se j<i sempre .1 |....|...... i
i+sz-1 j
a=i|j<>i| =#.5 |<?#.1 ; se j>i se i+sz<=j#.1, altrimenti .0
|.....|......|
a+=r|a<=j#.1 ; sej==i+sz ? non si legge in i+sz==j !
.0: c=^20|r=^20|r&=3|=#.f|--c ; parte per ovviare agli errori di overlap, c in
0..sz-1
a=^20|a-=r|jc .e|r=a |#.b ; copia all'indietro
.a: al=*i+c|*j+c=al|--c
.b: c>=r?#.a|++c ; è importante capire B*j+3 scrive 8 bit in [&j+3..&j+4)
.c: #.f ; altrimenti mi viene difficile capire il resto
.d: a=*i+c|*j+c=a
.f: c-=4 |>=?#.d
#.5
.e: a=0 |stc|#.z
.1: r&=0FFFFFFFCh|#.3 ; parte per copia in avanti
.2: a=*i+c|*j+c=a |c+=4
.3: c<r#.2
r=^20|r&=3| =#.5 |r+=c ; per i resti: se resta 1 => r+=1
.4: al=*i+c|*j+c=al| ++c ; loop gira per c fino a r compreso [ma non r+1]
c<r#.4
.5: a=j|clc
.z:
>i,j
ret 12
;u32 MmrSet(u8* d, u32 ch, u32 sz)
;riempie l'array puntato da "d" con "sz" char "ch"
;ritorna i caratteri copiati
;0j,4i,8ra, 12P_d, 16P_o, 20P_sz
align 4
MmrSet:
<i,j
j=^12 |i=^16 |r=^20 |c^=c
j==0#.e|i>0FFh#.e|r<0?#.e| =#.5
#.1
.e: a=0 |stc|#.z
.1: r&=0FFFFFFFCh
a =i|a<<=8|a|=i|a<<=8
a|=i|a<<=8|a|=i ; 4 u8 == 1 u32
#.3
.2: *j+c=a |c+=4
.3: c<r#.2
r=^20|r&=3| =#.5 |r+=c
.4: *j+c=al | ++c
c<r#.4
.5: a=c
clc
.z:
>i,j
ret 12
;u32 MmrCmp(u8* d, u8* o, u32 sz)
; ritorna -1 CF=0 se d <o
; ritorna 0 CF=0 se d==o
; ritorna 1 CF=0 se d >o
; ritorna -3 CF=1 per errore
;0j,4i,8ra, 12P_d, 16P_o, 20P_sz
align 4
MmrCmp:
<i,j
j=^12 |i=^16 |r=^20 |c^=c
j==0#.e|i==0#.e|r<0?#.e| =#.5
#.1
.f: r=-1|a <>*j+c|r++=0|jnz .g|r=1
.g: a=r |clc|#.z
.h: r=-1|al<>*j+c|r++=0|jnz .g|r=1|#.g
.e: a=-3|stc|#.z
.1: i==j#.5 |r&=0FFFFFFFCh|#.3 ; i==j hanno stesso indirizzo
.2: a=*i+c|*j+c!=a#.f|c+=4
.3: c<r#.2
r=^20|r&=3| =#.5 |r+=c
.4: al=*i+c|*j+c!=al#.h| ++c
c<r#.4
.5: a^=a
.z:
>i,j
ret 12
;u32 MmrSCpy(u8* d, u32 dsz, u8* o, u32 sz)
;scrive in 'd', di dimensione in size 'dsz', 'sz' char di 'o'
;ritorna 0 CF==1 per errore
;ritorna d CF==0 tutto ok con "d" l'array di partenza
;NB: è possibile che ci siano problemi se gli indirizzi dei
;caratteri degli array si sovrappongono
;ma non ho trovato bugs con semplici test di comparazione
;con memmove()...[possibilemente legge scrive elmenti non allineati a u32*]
;0j,4i,8ra, 12P_d, 16P_dsz, 20P_o, 24P_sz
align 4
MmrSCpy:
<i,j
j=^12 |i=^20 |r=^24 |c^=c |^16<0?#.e ; j i
j==0#.e |i==0#.e|r<0?#.e| =#.5|^16<r #.e ; se j<i sempre .1
|....|...... i i+sz-1 j
a=i|j<>i| =#.5 |<?#.1 ; se j>i se i+sz<=j#.1, altrimenti
.0 |.....|......|
a+=r|a<=j#.1 ; sej==i+sz ? non si legge in
i+sz==j !
.0: c=^24|r=^24|r&=3|=#.f|--c ; parte per ovviare agli errori di overlap, c in
0..sz-1
a=^24|a-=r|jc .e|r=a |#.b ; copia all'indietro
.a: al=*i+c|*j+c=al|--c
.b: c>=r?#.a|++c ; è importante capire B*j+3 scrive 8 bit in [&j+3..&j+4)
.c: #.f ; altrimenti mi viene difficile capire il resto
.d: a=*i+c|*j+c=a
.f: c-=4 |>=?#.d
#.5
.e: a=0 |stc|#.z
.1: r&=0FFFFFFFCh|#.3 ; parte per copia in avanti
.2: a=*i+c|*j+c=a |c+=4
.3: c<r#.2
r=^24|r&=3| =#.5 |r+=c ; per i resti: se resta 1 => r+=1
.4: al=*i+c|*j+c=al| ++c ; loop gira per c fino a r compreso [ma non r+1]
c<r#.4
.5: a=j|clc
.z:
>i,j
ret 16
;u32 ArrLeggi8(u8* elm, u32** v, u32 index)
; non legge quello che non esiste
;0j,4i,8ra, 12P_elm,16P_v, 20P_Index
align 4
ArrLeggi8:
<i,j
c=^16|^12==0#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=-1| stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|j=^12 |cl=*r+a|*j=cl
a^=a
.z:
>i,j
ret 12
;u32 ArrLeggi16(u16* elm, u32** v, u32 index)
; non legge quello che non esiste
;0j,4i,8ra, 12P_elm,16P_v, 20P_Index
align 4
ArrLeggi16:
<i,j
c=^16|^12==0#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=-1| stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|j=^12 |cx=*r+a|*j=cx
a^=a
.z:
>i,j
ret 12
;u32 ArrLeggi32(u32* elm, u32** v, u32 index)
; non legge quello che non esiste
;0j,4i,8ra, 12P_elm,16P_v, 20P_Index
align 4
ArrLeggi32:
<i,j
c=^16|^12==0#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=-1| stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|j=^12 |c=*r+a|*j=c
a^=a
.z:
>i,j
ret 12
;u32 ArrCLeggi8(u32** v, u32 index)
;non legge quello che non esiste
; Ritorna a==-1 CF==1 errore
; Ritorna a== 0 CF==0 ed in ecx l'elemento letto
;0j,4i,8ra, 12P_v, 16P_Index
align 4
ArrCLeggi8:
<i,j
c=^12 |j=^16
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=-1| stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|cl=*r+a
a^=a
.z:
>i,j
ret 8
;u32 ArrCLeggi16(u32** v, u32 index)
; non legge quello che non esiste
; Ritorna a==-1 CF==1 errore
; Ritorna a== 0 CF==0 ed in ecx l'elemento letto
;0j,4i,8ra, 12P_v, 16P_Index
align 4
ArrCLeggi16:
<i,j
c=^12 |j=^16
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=-1| stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|cx=*r+a
a^=a
.z:
>i,j
ret 8
;u32 ArrCLeggi32(u32** v, u32 index)
; non legge quello che non esiste
; Ritorna a==-1 CF==1 errore
; Ritorna a== 0 CF==0 ed in ecx l'elemento letto
;0j,4i,8ra, 12P_elm,16P_v, 20P_Index
align 4
ArrCLeggi32:
<i,j
c=^12 |j=^16
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=-1| stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|c=*r+a
a^=a
.z:
>i,j
ret 8
;u32 ArrLeggi(u32* elm, u32** v, u32 index)
; non legge quello che non esiste. legge un intero elemento
; con indice "index", e lo scrive in elm, non modifica l'array.
; Ritorna a==-1 CF==1 errore
; Ritorna a== 0 CF==0 ed in ecx l'elemento letto
;0j,4i,8ra, 12P_elm,16P_v, 20P_Index
align 4
ArrLeggi:
<i,j
c=^16|^12==0#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=-1|stc|#.z
.1: j>=*i+iSup#.e
a=*i+objSz|mul j|r#.e|a<0?#.e
c^=c|r=*i+arrv|j=^12 |r+=a
a=*i+objSz|MmrCpy(j,r,a)|jc .e
a^=a
.z:
>i,j
ret 12
; u32 ArrPrelevaElm(u32* pelm, u32** v, u32 index)
; preleva l'elemento dall'array
; accorcia l'array di uno
;0k,4j,8i,12b,16ra, 20P_pelm,24P_v,28P_Index
align 4
ArrPrelevaElm:
<b,i,j,k
c=^24|^20==0#.e|j=^28
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=-1|stc|#.z
.1: j>=*i+iSup#.e
a=*i+objSz|mul j|r#.e |a<0?#.e
c^=c|b=*i+arrv |j=^20|b+=a
a=*i+objSz|MmrCpy(j,b,a)|jc .e ; copia l'elemento
; j..iSup-1 --> j-1..iSup-2
k=*i+iSup| k-=j|<?#.e
a=*i+objSz|mul k|r#.e |a<0?#.e
r=b|r+=*i+objSz|jc .e
MmrCpy(b, r, a)|jc .e
a^=a
.z:
>b,i,j,k
ret 12
; u32 ArrSwapElm(u32** v, u32 ind, u32 ind1)
;0k,4j,8i,12b,16ra, 20P_v,24P_ind,28P_Ind1
align 4
ArrSwapElm:
<b,i,j,k
a=^20|ArrInfo(a)|jnc .1
.e0: Free_m(b)
.e: a=-1 |stc|#.z
.1: k=*a+iSup|i=^24 |j=^28|c<=0?#.e|k<=0?#.e
i>=k#.e |j>=k#.e|i==j#.9
b=r ;in b l'indirizzo dell'array allocato, c==objsz
a=i|mul c|r#.e|a<0?#.e|i=a|i+=b|jc .e ; &v[i]
a=j|mul c|r#.e|a<0?#.e|j=a|j+=b|jc .e ; &v[j]
k=c|Malloc_m(c)|a==0#.e|b=a ; k=objsz
MmrCpy(b, i, k)|jc .e0
MmrCpy(i, j, k)|jc .e0
MmrCpy(j, b, k)|jc .e0
Free_m(b)|jc .e
.9: a^=a
.z:
>b,i,j,k
ret 12
; u32 ArrDeleteElm(u32** v, u32 index)
; elimina l'elemento di indice 'index'
;0k,4j,8i,12b,16ra, 20P_v,24P_Index
align 4
ArrDeleteElm:
<b,i,j,k
c=^20 |j=^24
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e0: D*i+iSup=0
.e: a=-1|stc|#.z
.1: j>=*i+iSup#.e
a=*i+objSz|mul j|r#.e |a<0?#.e
c^=c|b=*i+arrv |b+=a
; j..iSup-1 --> j-1..iSup-2
k=*i+iSup |k-=1 |k-=j |<?#.e
a=*i+objSz|mul k|r #.e|a<0?#.e
r=b|r+=*i+objSz |jc .e
MmrCpy(b, r, a) |jc .e
--D*i+iSup|<?#.e0
a^=a
.z:
>b,i,j,k
ret 8
; u32 ArrDeleteIrange(u32** v, u32 index0, u32 index1)
; elimina gli l'elementi di indice 'index0'..'index1'
; se indice1 >= iSup ritorna il numero degli elementi
; correttamente eliminati
; NB: index0<= index1
;0j,4i,8ra, 12P_v,16P_Index,20P_Index1
align 4
ArrDeleteIrange:
<i,j
i=^16|j=^20|j<0?#.e|i<>j|<=#.1
.e: a=j|a-=i|stc|#.z
.1: j-=i |++j ; 5,4,3,2,1,0
.2: a=^12|ArrDeleteElm(a,i)|jc .e|--j#.2
a^=a
.z:
>i,j
ret 12
;u32 ArrPopT(u32* pelm, u32** v)
;pop from the tail
;0ra, 4P_pelm, 8P_v
align 4
ArrPopT:
a=^8|a==0#.e|r=*a+4|r#.1
.e: a=-1|stc|#.z
.1: a=*r+iSup|c=^4|a==0#.e|r=^8|--a
ArrPrelevaElm(c, r, a)
.z:
ret 8
;u32 ArrPopH(u32* pelm, u32** v)
; pop from the head
;0ra, 4P_pelm, 8P_v
align 4
ArrPopH: a=^4|c=^8|ArrPrelevaElm(a,c,0)|ret 8
; u8* ArrRtnElm(u32** v, u32 index)
; se l'indice non esiste ritorna errore
; con indice "index", e lo scrive in elm.
; Ritorna a==0 CF==1 errore
; Ritorna a==p CF==0 ed in p puntatore elemento.
;0j,4i,8r,12ra, 16P_v, 20P_Index
align 4
ArrRtnElm:
<r,i,j
a=^16 |j=^20
a==0#.e|i=*a+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j>=*i+iSup#.e
a =*i+objSz|mul j|r#.e|a<0?#.e
a+=*i+arrv |jc .e
.z:
>r,i,j
ret 8
;0ra, 4P_v
align 4
ArrHead: a=^4|ArrRtnElm(a, 0)|ret 4
;0ra, 4P_v
align 4
ArrTail:
c=^4|ArriSupNobj(c) |jc .e
c=^4|--a|ArrRtnElm(c,a)|#.1
.e: a=0|stc
.1:
ret 4
;u32 ArrLeggiNelm(u32* pelm, u32 nelm, u32** v, u32 index )
;non legge quello che non esiste. Legge dal vettore "v" a partire
;dall'elemento "index", "nelm" elementi e li scrive tutti in "pelm"
;0k,4j,8i,12b,16ra, 20P_pelm,24P_Nelm, 28P_v, 32P_Index
align 4
ArrLeggiNelm:
<b,i,j,k
^20==0#.e|b=^24
c=^28 |b<0?#.e| =#.9|j=^32 ; se continua b!=0
c==0#.e |i=*c+4 |j<0?#.e|i#.1
.e: a=-1|stc|#.z
.1: j+=b|jc .e|<?#.e|j>=*i+iSup#.e ; calcola che l'indice da raggiungere
j-=b ; sia minore dell'indice massimo.
a=*i+objSz|mul j|r#.e|a<0?#.e|k=a ; in k la posizione del vett. dove
iniziare
a=*i+objSz|mul b|r#.e|a<0?#.e ; in a il nBytes da copiare
r=*i+arrv |j=^20|r+=k|MmrCpy(j,r,a)|jc .e
.9: a^=a
.z:
>b,i,j,k
ret 16
;u32 ArrSort(u32** v, u32 (*cmp)(u32 E1, u32 E2) )
;notare che la funzione cmp() **non** è stdcall ed ha argomenti
;che sono gli elementi [*i+E] del nodo [che possono essere anche puntatori].
;
;alloca lo spazio per un numero di puntatori
;pari al numero di elementi, li assegna al vettore
;alloca un buffer temporaneo per tutti gli elementi dell'array
;ordina l'array di puntatori
;copia gli elementi corrispondenti ai puntatori ordinati
;nel buffer temporaneo; copia il buffer temporaneo, nell'array;
;free il buffer temporaneo e il vettore di puntatori.
;0k,4j,8i,12b,16ra, 20P_v, 24P_cmp + 32
; 52 56
align 4
ArrSort:
<b,i,j,k
s-=32
a=^52|b=^56|a==0#.f|b==0#.e
#.1
.e1: a=^12|Free_m(a)
.e0: a=^4 |Free_m(a)
.e: a=-1|stc|#.z
.1: i=*a+4|i==0#.f|k=*i+iSup|k<=1?#.f ; 0 o 1 elmenti => esci
D*i+objSz<=0?#.e
a=*i+objSz|a<=0?#.e |mul k|r#.e|a<0?#.e|k=a |^20=a ; k=size totale
a=*i+iSup |a<<=2|^8=a|a+=4|Malloc_m(a)|a==0#.e|^4=a ; array dei puntatori
Malloc_m(k)|a==0#.e0|^12=a ; array degli elementi
; assegna i puntatori all'array
j=*i+arrv|j==0#.e|b=^4|r=^4|r+=^8 ; in r la fine
.2: *b=j|j+=*i+objSz|b+=4|b<r#.2
; ordiniamo l'array di puntatori
b=^4|a=^56|c=*i+iSup|qsortPnt_m<(b,c,a)|jc .e1
; copiamo il risultato nell'array temporaneo
j=^12|k=*i+objSz|r=b|r+=^8|^16=r
.3: a=*b|MmrCpy(j,a,k)|jc .e1|j+=k|b+=4|b<^16#.3
; copiamo l'array tmporaneo nell'array di origine
b=*i+arrv|j=^12|a=^20|a<0?#.e1|MmrCpy(b,j,a)|jc .e1
Free_m(j)|jc .e0|a=^4|Free_m(a)|jc .e
.f: a^=a
.z:
s=&*s+32
>b,i,j,k
ret 8
; u32 ArrFindNext(u32** v, u32 index, u32 std (*cmp)(u32* E1))
; Cerca dopo l'elemento di indice 'index',
; il primo elemento della lista che fa annullare cmp().
; Se index==-1 inizia dall'origine.
; ritorna indiceNew cf==1 l'indice dell'elemento trovato se lo trova
; ritorna -1 cf==0 per non trovato
; ritorna -2 cf==0 per errore
; NB: notare che stc significa trovato
; 0k,4j,8i,12b,16ra, 20P_v, 24P_index, 28P_cmp, + 32
; 52 56 60 64
align 4
ArrFindNext:
<b,i,j,k
s-=32
a=^52 |k=^56 |b=^60
a==0#.e|++k |k<0?#.e ; ++(-1)=0
b==0#.e|i=*a+4|i==0#.f
D*i+objSz<=0?#.e|D*i+iSup==0?#.f|<?#.e
#.1
.f: a=-1|clc|#.z
.e: a=-2|clc|#.z
.1: ^4=k ; indice attuale
.2: k>=*i+iSup#.f
j=*i+arrv |j==0#.e|a=*i+objSz|mul k|r#.e|a<0?#.e |j+=a|jc .e ; inizio da j
k=*i+objSz|a=*i+iSup|mul k|r#.e|a<0?#.e|b=*i+arrv|b+=a|jc .e ; finisco in b
i=^60
.3: i(j)|a==0#.4|++^4|j+=k|j<b#.3|#.f
.4: a=^4|stc
.z:
s=&*s+32
>b,i,j,k
ret 12
; u32 ArrFindNextu8(u32** v, u32 index, u32 elm)
; Cerca dopo l'elemento di indice 'index',
; il primo elemento della lista che fa annullare cmp().
; Se index==-1 inizia dall'origine.
; ritorna indiceNew cf==1 l'indice dell'elemento trovato se lo trova
; ritorna -1 cf==0 per non trovato
; ritorna -2 cf==0 per errore
; NB: notare che stc significa trovato
; 0k,4j,8i,12b,16ra, 20P_v, 24P_index, 28P_elm, + 32
; 52 56 60
align 4
ArrFindNextu8:
<b,i,j,k
s-=32
a=^52 |k=^56 |b=^60
a==0#.e|++k |k<0?#.e ; ++(-1)=0
b>0FFh#.e|i=*a+4|i==0#.f
D*i+objSz<=0?#.e|D*i+iSup==0?#.f|<?#.e
#.1
.f: a=-1|clc|#.z
.e: a=-2|clc|#.z
.1: ^4=k ; indice attuale
.2: k>=*i+iSup#.f
j=*i+arrv |j==0#.e|a=*i+objSz|mul k|r#.e|a<0?#.e |j+=a|jc .e ; inizio da j
k=*i+objSz|a=*i+iSup|mul k|r#.e|a<0?#.e|b=*i+arrv|b+=a|jc .e ; finisco in b
c=^60
.3: *j==cl#.4|++^4|j+=k|j<b#.3|#.f
.4: a=^4|stc
.z:
s=&*s+32
>b,i,j,k
ret 12
; u32 ArrFindNextu32(u32** v, u32 index, u32 elm)
; Cerca dopo l'elemento di indice 'index',
; il primo elemento della lista che fa annullare cmp().
; Se index==-1 inizia dall'origine.
; ritorna indiceNew cf==1 l'indice dell'elemento trovato se lo trova
; ritorna -1 cf==0 per non trovato
; ritorna -2 cf==0 per errore
; NB: notare che stc significa trovato
; 0k,4j,8i,12b,16ra, 20P_v, 24P_index, 28P_elm, + 32
; 52 56 60
align 4
ArrFindNextu32:
<b,i,j,k
s-=32
a=^52 |k=^56|b=^60
a==0#.e|++k |k<0?#.e ; ++(-1)=0
i=*a+4 |i==0#.f
D*i+objSz<=0?#.e|D*i+iSup==0?#.f|<?#.e
#.1
.f: a=-1|clc|#.z
.e: a=-2|clc|#.z
.1: ^4=k ; indice attuale
.2: k>=*i+iSup#.f
j=*i+arrv |j==0#.e|a=*i+objSz|mul k|r#.e|a<0?#.e |j+=a|jc .e ; inizio da j
k=*i+objSz|a=*i+iSup|mul k|r#.e|a<0?#.e|b=*i+arrv|b+=a|jc .e ; finisco in b
c=^60
.3: *j==c#.4|++^4|j+=k|j<b#.3|#.f
.4: a=^4|stc
.z:
s=&*s+32
>b,i,j,k
ret 12
; u32 ArrFindNextAu8(u32** v, u32 index, u8* arr, u32 arrSz)
; Cerca dopo l'indice 'index', la prima sottostringa uguale ad arr[0..arrsz-1]
; NB: case sensitive
; Se index==-1 inizia dall'origine.
; ritorna indiceNew cf==1 l'indice dell'elemento trovato se lo trova
; ritorna -1 cf==0 per non trovato
; ritorna -2 cf==0 per errore
; NB: notare che stc significa trovato
; 0k,4j,8i,12b,16ra, 20P_v, 24P_index, 28P_arr, 32P_arrSz, + 32
; 52 56 60 64
align 4
ArrFindNextAu8:
<b,i,j,k
s-=32
a=^52 |k=^56|b=^60|^64<=0?#.e
a==0#.e|++k |k<0?#.e ; ++(-1)=0
i=*a+4 |i==0#.f |b==0#.e
D*i+objSz!=1#.e ; l'unico array permesso è un array di 8 bit==1 char
a=*i+iSup|a<^64#.f|a==0#.f|<?#.e
#.1
.f0: Free_m(j)
.f: a=-1|clc|#.z
.e0: Free_m(j)
.e: a=-2|clc|#.z
.1: ^4=k|r=^64 ; k indice attuale dove cercare
a-=k|<?#.f|a<r#.f
.2: a=^64|a<<=2|a+=4|Malloc_m(a)|a==0#.e|j=a ; array dei next
c=^64|InitKmn(a, c, b, c) |jc .e0
c=*i+iSup|c-=k|=#.f0|<?#.e0 |a=*i+arrv|a+=k|r=^64
Kmn(b, r, a, c, j)|jnc .f0 |k=a
Free_m(j)|jc .e
a=k|a-=*i+arrv|stc
.z:
s=&*s+32
>b,i,j,k
ret 16
; u32 ArrApplica1(u32** v, u32 std (*f)(u32* elemento))
; la funzione 'f' e' stdcall deve ritornare 0 tutto ok altrimenti errore
; tratta dal libro 'Programmazione Nella Pratica' di Brian W. Kerninghan, Rob
Pike
; ritorna -1 cf==1 errore di lista
; ritorna 3 cf==1 errore di funzione
; ritorna 0 cf==0 tutto ok
; 0k,4j,8i,12b,16ra, 20P_v, 24P_fun + 8
; 28 32
align 4
ArrApplica1:
<b,i,j,k
s-=8
a=^28|b=^32|a==0#.e|i=*a+4|b==0#.e|i==0#.f
D*i+objSz<=0?#.e|D*i+iSup==0?#.f|<?#.e
#.1
.e: a=-1|stc|#.z
.1: k=*i+iSup|a=*i+objSz|j=*i+arrv|j==0#.e
mul k|r#.e|a<0?#.e|k=a|k+=j|jc .e
.2: b(j)|j+=*i+objSz|jc .e|j<k#.2
.f: a^=a
.z:
s=&*s+8
>b,i,j,k
ret 8
; ; u32 ArrApplica2(u32** v, u8* daPassare, u32 std (*f)(u8* daPassare, u8*
elem))
; la funzione 'f' e' stdcall deve ritornare 0 tutto ok altrimenti errore
; tratta dal libro 'Programmazione Nella Pratica' di Brian W. Kerninghan, Rob
Pike
; ritorna -1 cf==1 errore di lista
; ritorna 3 cf==1 errore di funzione
; ritorna 0 cf==0 tutto ok
; 0k,4j,8i,12b,16ra, 20P_v, 24P_daPassare, 28P_fun + 8
; 28 32 36
align 4
ArrApplica2:
<b,i,j,k
s-=8
a=^28|b=^36|a==0#.e|i=*a+4|b==0#.e|i==0#.f
D*i+objSz<=0?#.e|D*i+iSup==0?#.f|<?#.e
#.1
.e: a=-1|stc|#.z
.e1: a= 3|stc|#.z
.1: k=*i+iSup |a=*i+objSz |j=*i+arrv |j==0#.e
mul k|r#.e|a<0?#.e|k=a|k+=j|jc .e|i=^32|^4=0
.2: b(i,j)|a==0#.3|^4=3
.3: j+=*i+objSz|jc .e|j<k#.2
.f: ^4#.e1
a^=a
.z:
s=&*s+8
>b,i,j,k
ret 12
;u32 printUns(StrMessage, nIntegers, 1integer, 2integer, ...)
;NB: Non è stdcall
;0ra,4..36,36P_strMessage, 36P_Nints, 40P_i1, 44P_i2, ... +1024
; 1060 1064 1068 ...
align 4
printUns:
pushad
s-=1024
i=^1064|b=&^1068|^16=0
.1: i==0#.4|i>80#.e |#.2
.e: s+=1024|popad|a=-1|stc|ret
.2: j=&^16|k=1000
.3: c=*b|a=s|D*a="%u "|Ps_m<(j,k,a,c)|a<=0?#.e|j+=a|k-=a|<=?#.e
b+=4|--i#.3
.4: a=^1060|a==0!#.5|a=s|D*a="Info"|D*a+4=0
.5: j=&^16|MessageBoxA(0,j,a,(&MB_OK| &MB_SYSTEMMODAL))
s+=1024
popad
a^=a
ret
;u32 ArrPrint(u32** v, u8* StrMessage, 1integer, 2integer)
;0ra,4..36,36P_v, 40P_strMessage, 44P_i1, 48P_i2, ... +1024
; 1060 1064 1068 1072
align 4
ArrPrint:
pushad
s-=1024
a=^1060|i=^1068|j=^1072
a==0#.e|b=*a+4 |b==0#.e0
i>j#.e1|a=j|a-=i|a>500#.e1
D*b+objSz<=0?#.e1
D*b+iSup==0#.e0
#.2
.e0: j="Array vuoto"|#.4a
.e1: j="Errore visualizzazione array"|^8=3|#.4a
.e: s+=1024|popad|a=-1 |stc |ret
.2: a=*b+objSz|a<=0?#.e1|mul i|r#.e1|a<0?#.e1
r=*b+arrv |r+=a|^16=r
^12=j|j>=*b+iSup!#.2a
a=*b+iSup|a==0#.e1|--a|^12=a
.2a: j=&^20|k=996 ; scrive il contenuto in numeri esadecimali
completamente in reverse.
.3: a=*b+objSz|^8=a ; Esempio: il numeoro "012345678," è scritto
"876543210,"
.3a:
c^=c|cl=*r|a=s|D*a="%2:0"|D*a+4="x"|Ps_m<(j,k,a,c)|a<=0?#.e1|j+=a|k-=a|<=?#.e1
a==2!#.30|al=*j-1|ah=*j-2|*j-1=ah|*j-2=al
.30: ++r|--^8#.3a
i==^12#.4|a=s|D*a=", "|Ps_m<(j,k,a)|a<=0?#.e1|j+=a|k-=a|<=?#.e1
.3b: ++i|i<=^12#.3
.4: k<=3#.e1|B*j=13|B*j+1=10|j+=2|k-=2|B*j=0
i=^1068|r=^16
.c: a=*b+objSz|^8=a ; e lo stesso loop di sopra per scrivere il contenuto
con %c caratteri
.ca: c^=c|cl=*r|c<32!#.ca0|c='*'
.ca0: a=s|D*a="%2:*"|D*a+4="c"|Ps_m<(j,k,a,c)|a<=0?#.e1|j+=a|k-=a|<=?#.e1
a==2!#.c0|al=*j-1|ah=*j-2|*j-1=ah|*j-2=al
.c0: ++r|--^8#.ca
i==^12#.6|a=s|D*a=", "|Ps_m<(j,k,a)|a<=0?#.e1|j+=a|k-=a|<=?#.e1
.cb: ++i|i<=^12#.c
.6: j=&^20 |^8=0
.4a: a=^1064|a==0!#.5|a=s|D*a="Info"|D*a+4=0
.5: MessageBoxA(0,j,a,(&MB_OK| &MB_SYSTEMMODAL))
^8#.e
s+=1024
popad
a^=a
ret 16
>> objSz, nObj, iSup, arrv
; ************ fine della libreria array
...
...
> Do you like my implementation of STL, vector like in asm? :)
> Afther i wrote some routine i understood is better use
> \0 terminated strings, and easier routines.
> So i should not use the routines below in my hobby code.
> Only one of these routine pass a full test
> some other has some debug session for see if they are ok
> some other only i write down whitout any run.
> Do you like how i comment functions?
Not all of us understand Italian or origin Latin ...
> Are them with too few comments?
Often a fewer, but understandable comments show more doubtfree info.
> What about the library lay out?
Library support may only be of interest for those who need/want it.
> to me it seems very good...
If it works well for you, I'd say keep on, but be aware that others
like me may see a machine from a different point :)
> the first u32 for the space of the pointer
> the sys use for the multithread
> the other u32 one pointer to a struct
> that define the array[or the list, or some other]...
perhaps nothing wrong in your personal approach, but as long noone
else than just you understand the logical meaning of it, you'll
find yourself in your own created cage even logically based :)
I'd recommend to change your posting style to common language
questions and perhaps also your view of logic to become understood :)
I know you since several years Rosario, so please don't see my notes
offending, just an attempt for a good meant advice ...
and even that talking to yourself can help a lot (I also practice this),
posting ideas need often a bit more explanation than just telling about.
__
wolfgang
It doesn't work well for him. He is constantly posting corrections. There
are entire threads with just his posts of corrections. *He* wrote the code
in *his* language. _Why_ so many errors? Does he expect other people to
code using it without errors, if he cannot? It is clearly a language in
preliminary development. It is too cryptic even for me, and apparently for
him also. He has been posting about it for many years, and no one has
offered to help him improve it. Maybe he needs to try posting elsewhere to
find support from like minded individuals, if there are any. Some links:
http://www.masm32.com/board/index.php
http://forum.nasm.us/
http://board.flatassembler.net/
http://www.bttr-software.de/forum/forum.php
Rod Pemberton
doubtfree not exist (at last for me)
some time i forget to change comments
where i change something other. but i have no danger for that
until now because my way of see is: believe to the code and
not the comment, but the comment can help to read.
one has to read the algo in the code
and the comment can help (someone has to change something
can not read the comment only without follow what code does)
At the few i know comment is useful in 2 way:
1) help to clear ideas on write at first (very important)
2) help to understand the code in read
but nobody has to believe in comment 100%
>> What about the library lay out?
>
> Library support may only be of interest for those who need/want it.
>
>> to me it seems very good...
>
> If it works well for you, I'd say keep on, but be aware that others
> like me may see a machine from a different point :)
the point is: the easier one
>> the first u32 for the space of the pointer
>> the sys use for the multithread
>> the other u32 one pointer to a struct
>> that define the array[or the list, or some other]...
>
> perhaps nothing wrong in your personal approach, but as long noone
> else than just you understand the logical meaning of it, you'll
> find yourself in your own created cage even logically based :)
>
> I'd recommend to change your posting style to common language
> questions and perhaps also your view of logic to become understood :)
the logic is to do one library easier to use, multilingual (asm, C, C++)
but for what regard array library, the above little library,
for example seen the code for use it (for debug search functions)
ArrIni(lista, 1, 0)|D*cnterr++=0 ; arr di u8
ArrPrint(lista, "Elemento array. -->", 0, 30)
ArrScriviNelm(lista, 0, "Dopo aver inserito elementi la lista1
contiene. ->", 49)
ArrPrint(lista, "Elemento array. -->", 0, 30)
;iint3
<k
k=-1
.r: ArrFindNextu8(lista, k, 'a')|k=a|jc .r
>k
<k
k=-1
.r1: ArrFindNext(lista, k, cmpc)|k=a|jc .r1
>k
int3
<k
k=-1
.r2: ArrFindNextAu8(lista, k, "contiene", 8)|k=a|jc .r2
>k
<k
k=-1
.r3: ArrFindNextAu8(lista, k, "Elementi" , 8)|k=a|jc .r3
>k
ArrFree(lista)|D*cnterr++=0
int3
a=*cnterr
seems more difficult to understand than the one of \0 terminated
string.
This is the speech for the array library, but this lay out could be ok
for other library example, list library done follow the same line
of array library below that seems to me very good.
> I know you since several years Rosario, so please don't see my notes
> offending, just an attempt for a good meant advice ...
>
> and even that talking to yourself can help a lot (I also practice this),
> posting ideas need often a bit more explanation than just telling about.
the book i read say if someone not understand something well, just explain
that to some other help to know where is the error,
and help to understand better what to do
or something about it
i'm agree on that
> __
> wolfgang
>
>
i'm one hard head (testa dura) so i not follow well what other says
What language is this? It clearly isn't C (nor is it BF). And since
it isn't C, why are you posting it in comp.lang.c?
--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
>> ArrIni(lista, 1, 0)|D*cnterr++=0 ; arr di u8
>> ArrPrint(lista, "Elemento array. -->", 0, 30)
>> ArrScriviNelm(lista, 0, "Dopo aver inserito elementi la lista1
>> contiene. ->", 49)
>> ArrPrint(lista, "Elemento array. -->", 0, 30)
>> ;iint3
>> <k
>> k=-1
>> .r: ArrFindNextu8(lista, k, 'a')|k=a|jc .r
>>>k
> [...]
>
> What language is this? It clearly isn't C (nor is it BF). And since
> it isn't C, why are you posting it in comp.lang.c?
Rosarios own languge is a mix of BASIC, C, and his own macro-RosASM.
His attempts to being read at all look like as he search for opposition
to improve his ideas.
I don't see too much wrong in this, because there are some logical
aspects in his attempts (an HLL variant of H.Kleebauer's 68000 syntax?)
there is nothing wrong on the logical approach to convert CPU-code
into human readable mnemonics, even only few of us (ASM-coders) can
or want follow this at all.
for me Rosario's source looks like scrambled HLA or abused PowerBasic :)
nevertheless Rosario's High level approach and Herbert's M68000-syntax
got one in common: noone else can understand what's meant there :)
even both seem to follow strict logic rules ...
perhaps we aren't prepared nor familiar with such language-attempts.
__
wolfgang
Has he said so, or is that just what you've inferred by reading it?
I've never seen him say anything about what this language is, or even
hint that it's defined somewhere. Then again, I don't read everything
he posts.
> I don't see too much wrong in this, because there are some logical
> aspects in his attempts (an HLL variant of H.Kleebauer's 68000
> syntax?)
Perhaps, but surely it doesn't belong in comp.lang.c.
> there is nothing wrong on the logical approach to convert CPU-code
> into human readable mnemonics, even only few of us (ASM-coders) can
> or want follow this at all.
>
> for me Rosario's source looks like scrambled HLA or abused PowerBasic :)
> nevertheless Rosario's High level approach and Herbert's M68000-syntax
> got one in common: noone else can understand what's meant there :)
> even both seem to follow strict logic rules ...
> perhaps we aren't prepared nor familiar with such language-attempts.
If it's not intended to be understood by anyone other than the author,
it barely qualifies to be called a "language". The purpose of a
language is to communicate.
Anyway, I've spent too much time paying attention to this.
> I've never seen him say anything about what this language is, or even
> hint that it's defined somewhere. Then again, I don't read everything
> he posts.
your languages, C, C++, plain asm, are all definition and laws
wrong
with the free i can write [i write] better code of the one the exit
yours language compilers
your code in C or C++ is hard sloppy, my code in that language
is 50% less sloppy of your one
all macro [or macro like]
is defined here:
^a=b --> mov dword[esp+eax], ebx
*a+b=c --> mov dword[eax+ebx], ecx
^a+8=b --> mov dword[esp+eax+8], ebx
*a+b+4=c --> mov dword[eax+ebx+4], ecx
etc
Macro ---> loro espanzioni
[il riferimento per le macro � il luogo dove sono definite
(le macro di sotto potrebbero esser non aggiornate) ]
a ---> eax
b ---> ebx
c ---> ecx
jx ---> di
i ---> esi
j ---> edi
ix ---> si
r ---> edx
rx ---> dx
rl ---> dl
rh ---> dh
s ---> esp
sx ---> sp
k ---> ebp
kx ---> bp
##�1 ---> jmp �1
�1=�2 ---> mov �1, �2
�1+=�2 ---> add �1, �2
�1-=�2 ---> sub �1, �2
�1++=�2 ---> adc �1, �2
�1--=�2 ---> sbb �1, �2
�1<->�2 ---> xchg �1, �2
�1<<=�2 ---> shl �1, �2
�1>>=�2 ---> shr �1, �2
�1<<<=�2 ---> rcl �1, �2
�1>>>=�2 ---> rcr �1, �2
�1&�2 ---> test �1, �2
�1=&�2 ---> lea �1, �2
�1&=�2 ---> and �1, �2
�1|=�2 ---> or �1, �2
�1^=�2 ---> xor �1, �2
<�1 ---> push �1
>�1 ---> pop �1
�1() ---> call �1
<�1,�2 ---> push �1 |push �2
>�1,�2 ---> pop �2 |pop �1
<�1,�2,�3 ---> push �1 |push �2 |push �3
>�1,�2,�3 ---> pop �3 |pop �2 |pop �1
<�1,�2,�3,�4 ---> push �1 |push �2 |push �3 |push �4
>�1,�2,�3,�4 ---> pop �4 |pop �3 |pop �2 |pop �1
<�1,�2,�3,�4,�5 ---> push �1 |push �2 |push �3 |push �4 |push �5
>�1,�2,�3,�4,�5 ---> pop �5 |pop �4 |pop �3 |pop �2 |pop �1
<�1,�2,�3,�4,�5,�6 ---> push �1 |push �2 |push �3 |push �4 |push �5 |push �6
>�1,�2,�3,�4,�5,�6 ---> pop �6 |pop �5 |pop �4 |pop �3 |pop �2 |pop �1
<�1,�2,�3,�4,�5,�6,�7 ---> push �1 |push �2 |push �3 |push �4 |push �5 |push
�6 |push �7
>�1,�2,�3,�4,�5,�6,�7 ---> pop �7 |pop �6 |pop �5 |pop �4 |pop �3 |pop �2 |pop
>�1
<�1,�2,�3,�4,�5,�6,�7,�8 ---> push �1 |push �2 |push �3 |push �4 |push �5
|push �6 |push �7 |push �8
>�1,�2,�3,�4,�5,�6,�7,�8 ---> pop �8 |pop �7 |pop �6 |pop �5 |pop �4 |pop �3
>|pop �2 |pop �1
�1=�2() ---> call �2 |mov �1, eax
�1(�2) ---> push �2 |call �1
�1=�2(�3) ---> push �3 |call �2 |mov �1, eax
�1<(�2) ---> push �2 |call �1 |add esp, 4
�1=�2<(�3) ---> push �3 |call �2 |add esp, 4 |mov �1, eax
�1(�2,�3) ---> push �3 |push �2 |call �1
�1=�2(�3,�4) ---> push �4 |push �3 |call �2 |mov �1, eax
�1<(�2,�3) ---> push �3 |push �2 |call �1 |add esp, 8
�1=�2<(�3,�4) ---> push �4 |push �3 |call �2 |add esp, 8 |mov �1, eax
�1(�2,�3,�4) ---> push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5) ---> push �5 |push �4 |push �3 |call �2 |mov �1, eax
�1<(�2,�3,�4) ---> push �4 |push �3 |push �2 |call �1 |add esp, 12
�1=�2<(�3,�4,�5) ---> push �5 |push �4 |push �3 |call �2 |add esp, 12 |mov �1,
eax
�1(�2,�3,�4,�5) ---> push �5 |push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6) ---> push �6 |push �5 |push �4 |push �3 |call �2 |mov �1,
eax
�1<(�2,�3,�4,�5) ---> push �5 |push �4 |push �3 |push �2 |call �1 |add esp, 16
�1=�2<(�3,�4,�5,�6) ---> push �6 |push �5 |push �4 |push �3 |call �2 |add esp,
16 |mov �1, eax
�1(�2,�3,�4,�5,�6) ---> push �6 |push �5 |push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6,�7) ---> push �7 |push �6 |push �5 |push �4 |push �3 |call
�2 |mov �1, eax
�1<(�2,�3,�4,�5,�6) ---> push �6 |push �5 |push �4 |push �3 |push �2 |call �1
|add esp, 20
�1=�2<(�3,�4,�5,�6,�7) ---> push �7 |push �6 |push �5 |push �4 |push �3 |call
�2 |add esp, 20 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7) ---> push �7 |push �6 |push �5 |push �4 |push �3 |push
�2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8) ---> push �8 |push �7 |push �6 |push �5 |push �4
|push �3 |call �2 |mov �1, eax
�1<(�2,�3,�4,�5,�6,�7) ---> push �7 |push �6 |push �5 |push �4 |push �3 |push
�2 |call �1 |add esp, 24
�1=�2<(�3,�4,�5,�6,�7,�8) ---> push �8 |push �7 |push �6 |push �5 |push �4
|push �3 |call �2 |add esp, 24 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7,�8) ---> push �8 |push �7 |push �6 |push �5 |push �4
|push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8,�9) ---> push �9 |push �8 |push �7 |push �6 |push �5
|push �4 |push �3 |call �2 |mov �1, eax
�1<(�2,�3,�4,�5,�6,�7,�8) ---> push �8 |push �7 |push �6 |push �5 |push �4
|push �3 |push �2 |call �1 |add esp, 28
�1=�2<(�3,�4,�5,�6,�7,�8,�9) ---> push �9 |push �8 |push �7 |push �6 |push �5
|push �4 |push �3 |call �2 |add esp, 28 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7,�8,�9) ---> push �9 |push �8 |push �7 |push �6 |push �5
|push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8,�9,�10) ---> push �10 |push �9 |push �8 |push �7 |push
�6 |push �5 |push �4 |push �3 |call �2 |mov �1, eax
�1<(�2,�3,�4,�5,�6,�7,�8,�9) ---> push �9 |push �8 |push �7 |push �6 |push �5
|push �4 |push �3 |push �2 |call �1 |add esp, 32
�1=�2<(�3,�4,�5,�6,�7,�8,�9,�10) ---> push �10 |push �9 |push �8 |push �7
|push �6 |push �5 |push �4 |push �3 |call �2 |add esp, 32 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7,�8,�9,�10) ---> push �10 |push �9 |push �8 |push �7 |push
�6 |push �5 |push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8,�9,�10,�11) ---> push �11 |push �10 |push �9 |push �8
|push �7 |push �6 |push �5 |push �4 |push �3 |call �2 |mov �1, eax
�1<(�2,�3,�4,�5,�6,�7,�8,�9,�10) ---> push �10 |push �9 |push �8 |push �7
|push �6 |push �5 |push �4 |push �3 |push �2 |call �1 |add esp, 36
�1=�2<(�3,�4,�5,�6,�7,�8,�9,�10,�11) ---> push �11 |push �10 |push �9 |push �8
|push �7 |push �6 |push �5 |push �4 |push �3 |call �2 |add esp, 36 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7,�8,�9,�10,�11) ---> push �11 |push �10 |push �9 |push �8
|push �7 |push �6 |push �5 |push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8,�9,�10,�11,�12) ---> push �12 |push �11 |push �10
|push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |call �2 |mov �1,
eax
�1<(�2,�3,�4,�5,�6,�7,�8,�9,�10,�11) ---> push �11 |push �10 |push �9 |push �8
|push �7 |push �6 |push �5 |push �4 |push �3 |push �2 |call �1 |add esp, 40
�1=�2<(�3,�4,�5,�6,�7,�8,�9,�10,�11,�12) ---> push �12 |push �11 |push �10
|push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |call �2 |add
esp, 40 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7,�8,�9,�10,�11,�12) ---> push �12 |push �11 |push �10
|push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |push �2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8,�9,�10,�11,�12,�13) ---> push �13 |push �12 |push �11
|push �10 |push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |call
�2 |mov �1, eax
�1<(�2,�3,�4,�5,�6,�7,�8,�9,�10,�11,�12) ---> push �12 |push �11 |push �10
|push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |push �2 |call �1
|add esp, 44
�1=�2<(�3,�4,�5,�6,�7,�8,�9,�10,�11,�12,�13) ---> push �13 |push �12 |push �11
|push �10 |push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |call
�2 |add esp, 44 |mov �1, eax
�1(�2,�3,�4,�5,�6,�7,�8,�9,�10,�11,�12,�13) ---> push �13 |push �12 |push �11
|push �10 |push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |push
�2 |call �1
�1=�2(�3,�4,�5,�6,�7,�8,�9,�10,�11,�12,�13,�14) ---> push �14 |push �13 |push
�12 |push �11 |push �10 |push �9 |push �8 |push �7 |push �6 |push �5 |push �4
|push �3 |call �2 |mov �1, eax
�1<(�2,�3,�4,�5,�6,�7,�8,�9,�10,�11,�12,�13) ---> push �13 |push �12 |push �11
|push �10 |push �9 |push �8 |push �7 |push �6 |push �5 |push �4 |push �3 |push
�2 |call �1 |add esp, 48
�1=�2<(�3,�4,�5,�6,�7,�8,�9,�10,�11,�12,�13,�14) ---> push �14 |push �13 |push
�12 |push �11 |push �10 |push �9 |push �8 |push �7 |push �6 |push �5 |push �4
|push �3 |call �2 |add esp, 48 |mov �1, eax
++�1 ---> inc �1
--�1 ---> dec �1
++�1,�2 ---> inc �1 |inc �2
--�1,�2 ---> dec �1 |dec �2
++�1,�2,�3 ---> inc �1 |inc �2 |inc �3
--�1,�2,�3 ---> dec �1 |dec �2 |dec �3
++�1,�2,�3,�4 ---> inc �1 |inc �2 |inc �3 |inc �4
--�1,�2,�3,�4 ---> dec �1 |dec �2 |dec �3 |dec �4
--�1#�2 ---> dec �1 |jnz �2
--�1!#�2 ---> dec �1 |jz �2
++�1#�2 ---> inc �1 |jnz �2
++�1!#�2 ---> inc �1 |jz �2
�1<>�2 ---> cmp �1, �2
�1#�2 ---> cmp �1, 0 |jne �2
�1!#�2 ---> cmp �1, 0 |je �2
�1<�2#�3 ---> cmp �1, �2 |jb �3
�1&�2#�3 ---> test �1, �2 |jnz �3
�1>�2#�3 ---> cmp �1, �2 |ja �3
�1<=�2#�3 ---> cmp �1, �2 |jbe �3
�1>=�2#�3 ---> cmp �1, �2 |jae �3
�1==�2#�3 ---> cmp �1, �2 |je �3
�1!=�2#�3 ---> cmp �1, �2 |jne �3
�1>=�2!#�3 ---> cmp �1, �2 |jb �3
�1<=�2!#�3 ---> cmp �1, �2 |ja �3
�1>�2!#�3 ---> cmp �1, �2 |jbe �3
�1&�2!#�3 ---> test �1, �2 |jz �3
�1<�2!#�3 ---> cmp �1, �2 |jae �3
�1!=�2!#�3 ---> cmp �1, �2 |je �3
�1==�2!#�3 ---> cmp �1, �2 |jne �3
�1==�2,�3#�4 ---> cmp �1, �2 |je �4 |cmp �1, �3 |je �4
�1==�2,�3,�4#�5 ---> cmp �1, �2 |je �5 |cmp �1, �3 |je �5 |cmp �1, �4 |je �5
�1==�2,�3,�4,�5#�6 ---> cmp �1, �2 |je �6 |cmp �1, �3 |je �6 |cmp �1, �4 |je
�6 |cmp �1, �5 |je �6
�1==�2,�3,�4,�5,�6#�7 ---> cmp �1, �2 |je �7 |cmp �1, �3 |je �7 |cmp �1, �4
|je �7 |cmp �1, �5 |je �7 |cmp �1, �6 |je �7
�1<�2?#�3 ---> cmp �1, �2 |jl �3
�1>�2?#�3 ---> cmp �1, �2 |jg �3
�1<=�2?#�3 ---> cmp �1, �2 |jle �3
�1>=�2?#�3 ---> cmp �1, �2 |jge �3
�1==�2?#�3 ---> cmp �1, �2 |je �3
�1!=�2?#�3 ---> cmp �1, �2 |jne �3
�1>=�2!?#�3 ---> cmp �1, �2 |jl �3
�1<=�2!?#�3 ---> cmp �1, �2 |jg �3
�1>�2!?#�3 ---> cmp �1, �2 |jle �3
�1<�2!?#�3 ---> cmp �1, �2 |jge �3
�1!=�2!?#�3 ---> cmp �1, �2 |je �3
�1==�2!?#�3 ---> cmp �1, �2 |jne �3
�1=�2+�3 ---> mov �1, �2 |add �1, �3
�1=�2-�3 ---> mov �1, �2 |sub �1, �3
=#�1 ---> jz �1
<#�1 ---> jb �1
>#�1 ---> ja �1
<=#�1 ---> jbe �1
>=#�1 ---> jae �1
=?#�1 ---> je �1
<?#�1 ---> jl �1
>?#�1 ---> jg �1
<=?#�1 ---> jle �1
>=?#�1 ---> jge �1
!#�1 ---> jnz �1
!<#�1 ---> jae �1
!>#�1 ---> jbe �1
!<=#�1 ---> ja �1
!>=#�1 ---> jb �1
!?#�1 ---> jne �1
!<?#�1 ---> jge �1
!>?#�1 ---> jle �1
!<=?#�1 ---> jg �1
!>=?#�1 ---> jl �1
(�1,�2)<<=�3 ---> shld �1, �2, �3
(�1,�2)>>=�3 ---> shrd �1, �2, �3
D ---> dword
W ---> word
B ---> byte
Q ---> qword
T ---> tword
#�1 ---> jmp short �1
>> I don't see too much wrong in this, because there are some logical
>> aspects in his attempts (an HLL variant of H.Kleebauer's 68000
>> syntax?)
i hope Herbert is right, as any other asmer
Hello
i forget to say in the alt.lang.asm i post one file
that allow the use of the language i use
with RosAsm.exe[one assembler]
the day 6-2-2011
your programming languages are all sloppy,[but not the .asm one]
machines want a precise language not one sloppy ones
i spoke too much, i don't know the code all you write
and the code i write is not as good as i say...
Excuse me if someone is offended
Buona giornata :)
Not offended, just bored.
Whatever language you're using, it's not C. Posting it to
comp.lang.c does nobody any good. This isn't about whether it's
better or worse. My advice: don't post to comp.lang.c unless you're
actually discussing the C programming language.
I do not expect you to follow this advice.
Back to ignoring you.
Geez if you hadn't quoted him I wouldn't have seen him since I killfiled
him ages ago.....
Point taken.
my errors 99% of times goes out the first time i run it,
i not sure for progs in C or C++ it is the same
the library goes too much long to post here;
these are only the few functions
è un numero rappresentato da una macro semplice
(parola significativa associata a numero).
I registri sono nomi brevi familiari a noi che li
usiamo sempre: a,b,c,r,i,j,k,s e sempre gli stessi con
semplici operazioni tra essi e con la memoria
[=, |=,&=, ^=, *, operazioni jmp, &, <>[cmp],
-=, +=, ++=, --=, <<=, >>=, stc, clc, call, etc]
;;
; definisco i numeri e il loro significato tramite macro
; per la piccola libreria sottostante: essi valgono per ciascuna
; funzione della libreria; quando le funzioni della libreria
; finiscono uso l'undef degli stessi.
<< objSz=0, nObj=4, iSup=8, arrv=12
; u32 ArrIni(u32** v, u32 objSz, u32 nObj)
; v e' puntatore a una regione di tipo dati di 2 u32
; entrambi zero alla prima chiamata,
; il primo non è usato [puo' essere usato da chi
; usa la libreria], il secondo viene riempito
; con un altro puntatore che punta alla struttura array di sopra.
; objSz è la dimensione di ciascun elemento da cui è formato l'array
; nObj è il numero di elementi di cui l'array ha memoria
; Esempio:
; u32 p[2]={0};
;u32 ArrTronca(u32** v, u32 index)
;tronca il vettore v ad avere indici utili [0..index] => iSup==index+1
;0j,4i,8ra,12P_v, 16P_index
align 4
ArrTronca:
<i,j
c=^12|j=^16|c==0#.e|j<0?#.e|i=*c+4|i==0#.e|#.1
.e: a=-1 |stc |#.z
.1: D*i+objSz<=0?#.e
*i+iSup<=j#.e
++j|*i+iSup=j
.9: a^=a
.z:
>i,j
ret 8
;u32 ArrScrivi8(u32** v, u32 index, u32 elm8)
;Ritorna &v[index]
;la scrittura ha senzo solo in indici 0..iSup
;notare che iSup è l'unico indice in cui non si è scritto
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrScrivi8:
<i,j
c=^12|^20>0FFh#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup #.e ; puo' scrivere in 0..iSup
<#.2|a=*i+nObj|j<a#.1a
++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j|#.2
.1a: ++D*i+iSup
.2: a=*i+objSz|a==0#.e|mul j|r#.e|a<0?#.e
r=*i+arrv |c=^20
.3: a+=r|jc .e|r=*i+objSz|j=a
*a=cl|--r |#.5
.4: ++a|B*a=0 |--r
.5: >?#.4 |a=j|clc
.z:
>i,j
ret 12
;u32 ArrScrivi16(u32** v, u32 index, u32 elm16)
;Ritorna &v[index]
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrScrivi16:
<i,j
c=^12|^20>0FFFFh#.e|j=^16
c==0#.e|i=*c+4 |j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup#.e
<#.2|a=*i+nObj|j<a#.1a|++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j|#.2
.1a: ++D*i+iSup
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
r=*i+arrv |c=^20
.3: a+=r|jc .e|j=a|*a=cx|++a ; +1
r=*i+objSz|r-=2|#.5
.4: ++a|B*a=0 |--r ; +1==2
.5: >?#.4 |a=j|clc
.z:
>i,j
ret 12
;u32 ArrScrivi32(u32** v, u32 index, u32 elm32)
;Ritorna &v[index]
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrScrivi32:
<i,j
c=^12 |j=^16
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup#.e
<#.2|a=*i+nObj|j<a#.1a|++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j|#.2
.1a: ++D*i+iSup
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
r=*i+arrv |c=^20
.3: a+=r|jc .e|j=a |*a=c|a+=3
r=*i+objSz|r-=4|#.5
.4: ++a|B*a=0 |--r
.5: >?#.4|a=j |clc
.z:
>i,j
ret 12
;u32 ArrPScrivi(u32** v, u32 index, u8* Pelm)
;copia un elemento in "v", nell'indice "index", a partire da Pelm32
;Ritorna &v[index]
;0j,4i,8ra, 12P_v, 16P_Index, 20P_elm
align 4
ArrPScrivi:
<i,j
c=^12 |j=^16 |^20==0#.e
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: j> *i+iSup#.e
<#.2|a=*i+nObj|j<a#.1a|++j|ArrResize(c, j)|jc .e|*i+iSup=j|--j|#.2
.1a: ++D*i+iSup
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
r=*i+arrv |c=^20 |r+=a
a=*i+objSz|MmrCpy(r,c,a)
; a CF settati da mmrcpy
.z:
>i,j
ret 12
; Ritorna a=iSup c=nObj del vettore CF==0
; Ritorna a=0 CF==1 se errore
; 0ra, 4P_v
align 4
ArrLen:
a=^4|a==0#.e|c=*a+4|c==0#.e
a=*c+iSup|c=*c+nObj|clc ; a è lindice massimo attualmente usato
#.1
.e: a=0|stc
.1:
ret 4
; Ritorna (objSz, arrv, &strutturaArray) in (c,r,a) rispettivamente e CF==0
; se errore ritorna a=0 CF==1
; {NB attraverso 'a' possiamo accedere a tutti i valori della struttura del
vettore}
; 0ra, 4P_v
align 4
ArrInfo:
c=^4|c==0#.e|a=*c+4 |a==0#.e
c=*a+objSz |r=*a+arrv|clc
#.1
.e: a=0|stc
.1:
ret 4
; Ritorna (iSup, arrv, nobj) in (c,r,a) rispettivamente e CF==0
; se errore ritorna a=0 CF==1
; {NB attraverso 'a' possiamo accedere a tutti i valori della struttura del
vettore}
; 0ra, 4P_v
align 4
ArrDbg:
c=^4|c==0#.e|a=*c+4 |a==0#.e
c=*a+iSup |r=*a+arrv|a=*a+nObj|clc
#.1
.e: a=0|stc
.1:
ret 4
; u32 ArrPnt(u32** cbuf)
; ritorna: a=-1 CF==1 per errore
; ritorna: a=puntoatore iniziale, CF==0 se tutto ok
; ritorna il puntatore iniziale
; 0ra, 4P_cbuf
align 4
ArrPnt:
a=^4 |a==0#.e|r=*a+4|r==0#.e|#.1
.e: a=-1 |stc |#.z
.1: a=*r+arrv |a==0#.e
clc
.z:
ret 4
; u32 ArrPushT(u32** v, u32* pelm)
; push in the tail
; 0ra,4P_v,8P_pelm
ArrPushT:
c=^4|ArrLen(c)|jc .e
#.1
.e: a=0 |stc|#.z
.1: c=^4|r=^8|ArrPScrivi(c, a, r)
.z:
ret 8
; u32 ArrPushT0(u32** v)
; push in the tail un elemento nullo nel caso che
; l'elemento precedente non sia nullo
;0k,4j,8i,12b,16ra, 20P_v
ArrPushT0:
<b,i,j,k
j=^20|j==0#.e|i=*j+4|i==0#.e
#.1
.e: a=-1 |stc|#.z
.1: b=*i+arrv|a=*i+objSz|k=*i+iSup
b==0#.e |a==0#.e |k==0#.3
c=k|--c ; costruire un elemento che punta a &v[iSup-1]
mul c|r#.e|a<0?#.e
a+=b ; a punta a &v[iSup-1]
r=*i+objSz
.2: B*a#.3|++a|--r|>?#.2|#.4
.3: ArrScrivi8(j, k, 0) |jc .e
.4: a^=a
.z:
>b,i,j,k
ret 4
;u32 ArrPInsert(u32** v, u32 index, u8* Pelm)
;se eventualmente presenti sposta di uno gli elementi index..iSup-1 in
index+1..iSup
;copia un elemento in "v", nell'indice "index", copia da Pelm32
;0k,4j,8i,12b,16ra, 20P_v, 24P_Index, 28P_elm
align 4
ArrPInsert:
<b,i,j,k
c=^20 |j=^24 |^28==0#.e
c==0#.e|i=*c+4|j<0?#.e|i#.1
.e: a=0|stc|#.z
.1: b=*i+arrv
k=*i+iSup|a=*i+nObj|k<a#.2
<c|++k|ArrResize(c, k)|>c|jc .e
.2: a=*i+objSz|mul j|r#.e|a<0?#.e|k=a ; b+k==&j j<=iSup
j<>*i+iSup| =#.6|>#.e ; sposta gli elementi di indice
j..iSup-1 -> j+1..iSup
c=*i+iSup |c-=j |<=?#.e
a=*i+objSz|mul c|r#.e |a<0?#.e|c=a ; c=(iSup-j)*objSz
a=*i+objSz|a+=k |jc .e|a+=b|jc .e ; a=&j+1
r=&*b+k ; r=&j
MmrCpy(a,r,c)|jc .e
.6: c=^28|b+=k|jc .e|a=*i+objSz|MmrCpy(b,c,a)|jc .z ; errore di memcpy è
compatibile
++D*i+iSup
.7: clc ; a settato
.z:
>b,i,j,k
ret 12
;u32 ArrPInsertArru8(u32** v, u32 index, u8* arr8, u32 arr8sz)
;se eventualmente presenti sposta di uno gli elementi index..iSup-1 in
index+1..iSup
;copia un elemento in "v", nell'indice "index", copia da Pelm32
;se tutto ok ritorna a=isup==len ed CF==0 [a==0 significa 0 elementi, a==1
significa 1 elementi etc]
;se errore ritorna a=-1 ed CF==1
;0k,4j,8i,12b,16ra, 20P_v, 24P_Index, 28P_arr8, 32P_arr8Sz + 64
; 84 88 92 96
align 4
ArrPInsertArru8:
<b,i,j,k
s-=64
c=^84 |j=^88 |^92==0#.e|a=^96|a<0?#.e
c==0#.e |i=*c+4|j<0?#.e |i#.1
.e: a=-1|stc|#.z
.1: c =*i+objSz|r^=r|c<=0?#.e|div c|r#.e ; calcolo dell'indice finale
^0=a ; in ^0 l'incremento degli indici
a+=*i+iSup |jc .e|<?#.e
b=*i+arrv|k=a|^4=a ; in ^4 l'indice nuovo iSup
a=*i+nObj|k>=a!#.2
c=^20|++k|ArrResize(c, k)|jc .e
.2: a=*i+objSz|mul j|r#.e|a<0?#.e|k=a ; b+k==&j j<=iSup
j<>*i+iSup| =#.6|>#.e ; sposta gli elementi di indice
j..iSup-1 -> j+^96..^4=iSup
c=*i+iSup |c-=j |<=?#.e
a=*i+objSz|mul c| r#.e|a<0?#.e|c=a ; c=(iSup-j)*objSz
a=k|a+=^96|jc .e|<?#.e|a+=b|jc .e ; a=&j+^96
r=b|r+=k |jc .e ; r=&j
MmrCpy(a,r,c)|jc .e
.6: c=^92|b+=k|a=^96|MmrCpy(b,c,a)|jc .z ; errore di memcpy è compatibile
c=^4|a=^4 |*i+iSup=c ; aggiorna iSup
.7: clc ; a settato
.z:
s=&*s+64
>b,i,j,k
ret 16
;u32 ArrPInsertStru8(u32** v, u32 index, u8* str)
; 0j,4i,8ra, 12P_v, 16P_Index, 20P_arr8
align 4
ArrPInsertStru8:
<i,j
i=^12|j=^20|i==0#.e|j==0#.e|#.1
.e: a=-1 |stc|#.z
.1: Strlen_m(j)|jc .e|a<0?#.e
r=^16|ArrPInsertArru8(i, r, j, a)
.z:
>i,j
ret 12
;u32 ArrCpy(u32** vr, u32** v)
;ArrCpy(vr, 0) pone vr==0
;ritorna a=-1 CF==1 se errore
;ritorna a=Len(vr) CF==0 se tutto ok
;0j,4i,8ra, 12P_vr, 16P_v
ArrCpy:
<i,j
i=^12|c=^16|i==0#.e|c==0#.f|#.1
.f: ArrResize(i,0)|jnc .z
.e: a=-1 |stc |#.z
.1: ArrReset(i)|jc .e
j=*c+4|a=*j+objSz|c=*j+iSup|a==0#.e|mul c| r#.e|a<0?#.e
r=*j+arrv|ArrPInsertArru8(i, 0, r, a)
.z:
>i,j
ret 8
;u32 ArrInsertIndx(u32** vr, u32 Indx, u32** v, u32 ind1, u32 ind2)
;inserisce a partire da Indx in vr, tutto quello che vi è in v
;tra gli indici ind1..ind2
;Se ind1..-1 inserisce in vr ind1..iSup_v-1
;ritorna a=-1 CF==1 se errore
;ritorna a=Len(vr) CF==0 se tutto ok
;0k,4j,8i,12b,16ra, 20P_vr, 24P_Indx, 28P_v, 32P_ind1, 36P_ind2
align 4
ArrInsertIndx:
<b,i,j,k
i=^20 |a=^24 |c=^28 |b=^32 |j=^36
i==0#.e |a<0?#.e|c==0#.e|b<0?#.e|b>j#.e
j==-1#.1|j<0?#.e
#.1
.e: a=-1|stc|#.z
.1: k=*c+4|k==0#.e|a=*k+iSup|a<=0?#.e
b>=a#.e
j==-1!#.2|j=a|--j
.2: j>=a#.e
a=*k+objSz|mul b|r#.e|a<0?#.e
a+=*k+arrv|b=a ; b e' l'inizio dell'array da copiare
j-=^32|a=*k+objSz|mul j|r#.e|a<0?#.e ; in a la sua lunghezza da copiare
c =^24|ArrPInsertArru8(i, c, b, a)
.z:
>b,i,j,k
ret 20
;u32 ArrAddArrI1I2(u32** vr, u32** v, u32 ind1, u32 ind2)
; aggiunge alla fine di vr, gli elementi di v: v[ind1....ind2]
; ritorna a=-1 CF==1 errore
; ritorna a=iSup(vr)==len(vr) CF==0 tutto ok
;0j,4i,8ra, 12P_vr, 16P_v, 20P_i1, 24P_i2
align 4
ArrAddArrI1I2:
<i,j
j=^12|r=^16|j==0#.e|r==0#.e|#.1
.e: a=-1|stc |#.z
.1: c=*j+4 |i=*r+4|c==0#.e|i==0#.e
a=*c+iSup|c=^20|i=^24|ArrInsertIndx(j, a, r, c, i)
.z:
>i,j
ret 16
; u32 ArrPushH(u32** v, u32* pelm)
; 0ra,4P_v,8P_pelm
ArrPushH: a=^4|c=^8|ArrPInsert(a, 0, c)|ret 8
;u32 ArrScriviNelm(u32** v, u32 index, u8* Pelm, u32 Nele)
;copia "Nele" in "v", nell'indice "index", a partire da Pelm32
;0k,4j,8i,12b,16ra, 20P_v, 24P_Index, 28P_pelm, 32P_Nele
align 4
ArrScriviNelm:
<b,i,j,k
c=^20 |j=^24 |^28==0#.e|k=^32
c==0#.e|i=*c+4|j<0?#.e| i==0#.e|k<0?#.e| =#.3
j>*i+iSup#.e ; je[0..iSup]
#.1
.e: a=-1| stc|#.z
.1: k+=j|jc .e| <=?#.e
a=*i+nObj|k>=a!#.2
++k|ArrResize(c, k)|jc .e
.2: a=*i+objSz|mul j |r#.e|a<0?#.e
b=*i+arrv |c=^28 |b+=a
k=^32|a=*i+objSz|mul k|r#.e|a<0?#.e
MmrCpy(b,c,a)|jc .e
j+=k
*i+iSup<j!#.3|*i+iSup=j
.3: a^=a
.z:
>b,i,j,k
ret 16
;u32 ArrImportaA(u32** v, u8* arrayMallocato, u32 arraymallcSzBytes, u32
arrmallLenBytes)
; importa un array malloccato, di data arraymallcSzBytes[in bytes],
; e dati elementi usati arrmallLenBytes[in bytes]
;
;NB: arrayMallocato, deve provenire da Malloc_m() o Realloc_m()
;0k,4j,8i,12b,16ra, 20P_v, 24P_arrM, 28P_arrMSz, 32P_ArrMLen
align 4
ArrImportaA:
<b,i,j,k
c=^20 |j=^24 |k=^28 |a=^32
c==0#.e|j==0#.e|k<=0?#.e|a<0?#.e|a>k#.e
i=*c+4 |b=*i+objSz |i==0#.e
r^=r |b<=0?#.e|a=k|div b|k=a
r#.e ; la dimensione diarrayMallocato deve essere un multiplo di objetsize
#.1
.e: a=-1|stc|#.z
.1: a=*i+arrv|Free_m(a)|jc .e
a^=a|*i+arrv=a|*i+nObj=a|*i+iSup=a
r^=r|a=^32|div b|r==0#.2|++a
.2: *i+iSup=a|*i+nObj=k|*i+arrv=j
.z:
>b,i,j,k
ret 16
;u32 ArrAddArru8(u32** v, u8* arr, u32 arrSzbytes)
; aggiunge alla fine di v, arr
; ritorna a=-1 CF==1 errore
; ritorna a=iSup==len CF==0 tutto ok
;0k,4j,8i,12b,16ra, 20P_v, 24P_arr, 28P_arrSz
align 4
ArrAddArru8:
<b,i,j,k
c=^20 |j=^24 |k=^28
c==0#.e|j==0?#.e|k<=0?#.e
i=*c+4 |c=*i+objSz|i==0#.e|c==0#.e
#.1
.e: a=-1|stc|#.z
.1: ; calcola l'indice di finita copiatura
a=k|r^=r |div c| r#.e|a<0?#.e ; r!=0 non si ammettono resti
a+=*i+iSup|jc .e| <=?#.e
b=a ; in b il nuovo iSup
c=*i+nObj|a>=c!#.2|c=^20|++a|ArrResize(c, a)|jc .e
; calcola la posizione di memoria dove iniziare
.2: a=*i+iSup|mul D*i+objSz|r#.e|a<0?#.e
c=*i+arrv|c==0#.e |c+=a|jc .e ; in c dove iniziare
; copia l'array di u8 arr, in v
MmrCpy(c,j,k)|jc .e
*i+iSup=b|a=b|clc
.z:
>b,i,j,k
ret 12
;u32 ArrAddArr(u32** vr, u32** v)
; ritorna a=-1 CF==1 errore
; ritorna a=iSup(vr)==len(vr) CF==0 tutto ok
;0j,4i,8ra, 12P_vr, 16P_v
align 4
ArrAddArr:
<i,j
j=^12|a=^16|j==0#.e|a==0#.e|#.1
.e: a=-1|stc|#.z
.1: c=*j+4|i=*a+4|c==0#.e|i==0#.e
a=*i+iSup|mul D*i+objSz|r#.e|a<0?#.e
r=*c+iSup|c=*i+arrv|ArrPInsertArru8(j, r, c, a)
.z:
>i,j
ret 8
;u32 ArrAddStru8(u32** v, u8* str)
;aggiunge alla fine di v, arr
; ritorna a=-1 CF==1 errore
; ritorna a=iSup==len CF==0 tutto ok
;0j,4i,8ra, 12P_v, 16P_str
align 4
ArrAddStru8:
<i,j
i=^12|j=^16|i==0#.e|j==0#.e
#.1
.e: a=-1|stc|#.z
.1: Strlen_m(j)|jc .e|a<0?#.e
ArrAddArru8(i, j, a)
.z:
>i,j
ret 8
; u8* ArrPntAnomeFinaleDalPath(u8* FileName)
; ritorna a=0 CF==1 per errore
; ritorna a=puntatore CF==0 se tutto ok, dove puntatore punta al primo
; carattere della parola alla fine del path
; 0ra, 4P_FileNamePath
ArrPntAnomeFinaleDalPath:
r=^4|r==0#.e|c=r|#.1
.e: a^=a|stc|#.z
.0: ++r
.1: B*r=='\'!#.2|B*r+1==0#.2|c=&*r+1
.2: B*r#.0
a=c
.9: clc
.z:
ret 4
;u32 ArrNomeFinaleDalPath(u32** v, u8* PathStr)
; estrae da PathStr, il nome del file e lo mette in v
; ritorna a=-1 CF==1 errore
; ritorna a=iSup==len CF==0 tutto ok
;0j,4i,8ra, 12P_vr, 16P_str
align 4
ArrNomeFinaleDalPath:
<i,j
a=^12 |j=^16|a==0#.e|j==0#.e
i=*a+4|i==0#.e|#.1
.e: a=-1 |stc |#.z
.1: D*i+iSup=0 ; arr vuoto
ArrPntAnomeFinaleDalPath(j)|jc .e
r=^12|ArrAddStru8(r, a)
.z:
>i,j
ret 8
;u32 ArrNomeFinaleDalPathArr(u32** vr, u32** v)
; estrae da PathStr, il nome del file e lo mette in v
; ritorna a=-1 CF==1 errore
; ritorna a=iSup==len CF==0 tutto ok
;0j,4i,8ra, 12P_vr, 16P_str
align 4
ArrNomeFinaleDalPathArr:
<i,j
a=^12 |r=^16|a==0#.e|r==0#.e
i=*a+4|j=*r+4|i==0#.e|j==0#.e|#.1
.e: a=-1 |stc |#.z
.1: D*i+iSup=0 ; arr vuoto
; completare
ArrPntAnomeFinaleDalPath(j)|jc .e
r=^12|ArrAddStru8(r, a)
.z:
>i,j
ret 8
;u32[index] ArrNomeFinaleIndexInPath(u32** v)
; estrae da PathStr, il nome del file e lo mette in v
; ritorna a=-1 CF==1 errore
; ritorna a=iSup==len CF==0 tutto ok
;0j,4i,8ra, 12P_vr
align 4
ArrNomeFinaleIndexInPath:
<i,j
a=^12 |a==0#.e
i=*a+4|i==0#.e|#.1
.e: a=-1 |stc |#.z
.1: j=*i+arrv|ArrPntAnomeFinaleDalPath(j)|jc .e
a-=j|c=*i+objSz|r^=r|c==0#.e| div c|clc
.z:
>i,j
ret 4
>
someont see this post?
of 4 servers I use your previous post is visible only on one...
--
drwxr-xr-x 2 bmaxa bmaxa 4096 2011-04-06 18:34 .
someone..
>>
>
> of 4 servers I use your previous post is visible only on one...
news.edisontel.com
has the post
> "io_x" <a...@b.c.invalid> ha scritto nel messaggio
> news:4d9f15f4$0$18250$4faf...@reader2.news.tin.it...
> someone see this post?
Yeah, I can see your posts in ALA, even I'm not
always sure what you mean :)
But I don't read C-groups.
__
wolfgang
i mean the .dll posted with the file
that is not C,
but the output of one version of RosAsm
+ the macro language i use [macro2d]
don't know if you consider it assembly; sure it is not
C or C++ or whatherver other know language.
the C++ code is just for debug, if i would like
to use the functions in that way possibly,
on error, i would zero all the date result
even if from that could follow very long loops...
in that .dll if somoene open it with RosAsm
there is something begin with
PREPARSE MACRO2D
%define GetLocalTime 'kernel32.GetLocalTime'
%define GetTimeZoneInformation 'kernel32.GetTimeZoneInformation'
section data
hInstance dd 0, 0
mesiIta dd mes0, mes1, mes2, mes3, mes4, mes5, mes6, mes7, mes8, mes9, mes10,
mes11
mesiIng dd mei0, mei1, mei2, mei3, mei4, mei5, mei6, mei7, mei8, mei9, mei10,
mei11
mesaIng dd mai0, mai1, mai2, mai3, mai4, mai5, mai6, mai7, mai8, mai9, mai10,
mai11 ; mesi abbre.
giorniIta dd gioI0, gioI1, gioI2, gioI3, gioI4, gioI5, gioI6
giorniIng dd giiI0, giiI1, giiI2, giiI3, giiI4, giiI5, giiI6
giornaIng dd giaI0, giaI1, giaI2, giaI3, giaI4, giaI5, giaI6 ; giorni
abbreviati
; 1 2 3 4 5 6 7 8 9 10 11 12
daytab db 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
daytabL db 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
mes0 db "Gennaio",0,0
mes1 db "Febbraio",0,0
mes2 db "Marzo",0,0
mes3 db "Aprile",0,0
mes4 db "Maggio",0,0
mes5 db "Giugnio",0,0
mes6 db "Luglio",0,0
mes7 db "Agosto",0,0
mes8 db "Settembre",0,0
mes9 db "Ottobre",0,0
mes10 db "Novembre",0,0
mes11 db "Dicembre",0,0
mei0 db "January",0,0
mei1 db "February",0,0
mei2 db "March",0,0
mei3 db "April",0,0
mei4 db "May",0,0
mei5 db "June",0,0
mei6 db "July",0,0
mei7 db "August",0,0
mei8 db "September",0,0
mei9 db "October",0,0
mei10 db "November",0,0
mei11 db "December",0,0
mai0 db "Jan",0,0
mai1 db "Feb",0,0
mai2 db "Mar",0,0
mai3 db "Apr",0,0
mai4 db "May",0,0
mai5 db "Jun",0,0
mai6 db "Jul",0,0
mai7 db "Aug",0,0
mai8 db "Sep",0,0
mai9 db "Oct",0,0
mai10 db "Nov",0,0
mai11 db "Dec",0,0
gioI0 db "Lunedi",0,0
gioI1 db "Martedi",0,0
gioI2 db "Mercoledi",0,0
gioI3 db "Giovedi", 0,0
gioI4 db "Venerdi",0,0
gioI5 db "Sabato",0,0
gioI6 db "Domenica",0,0
giiI0 db "Monday",0,0
giiI1 db "Tuesday",0,0
giiI2 db "Wednesday",0,0
giiI3 db "Thursday", 0,0
giiI4 db "Friday",0,0
giiI5 db "Saturday",0,0
giiI6 db "Sunday",0,0
giaI0 db "Mon",0,0
giaI1 db "Tue",0,0
giaI2 db "Wed",0,0
giaI3 db "Thu", 0,0
giaI4 db "Fri",0,0
giaI5 db "Sat",0,0
giaI6 db "Sun",0,0
section bss
section text
; DLL entry point - do nothing, but flag success
; This is a STDCALL entrypoint, so remove 3 params from stack on return
; ..start:
; dllstart:
; mov eax,1
; ret 12
; BOOL WINAPI DllMain
; (HINSTANCE hInstance, ULONG Reason, PCONTEXT Context )
; 0k,4j,8i,12r,16c,20b, 24ra, 28P_his, 32P_Reason, 36P_Contex
; 0ra, 4P_his, 8P_Reason, 12P_Contex
align 4
Main:
a=^4|*hInstance=a
; iint3
; colui che chiama ha l'obbligo di inizializzare
; e liberare tutto [qui non c'e' niente da inizializzare]
.1: a=&TRUE
.z:
ret 12
;-----------------------------------Libreria Tempo
;;
Mdate.DLL
Volevo scrivere un esempio di piccola libreria usando il linguaggio Macro2d
da rendere pubblico. L'occasione mi si presenta quando dovevo usare le
funzioni di tempo, e in omaggio a tutti quelli che dicono di non reinventare
l'acqua calda ... li ho scritte.
Le funzioni di tempo, il tempo che non possiamo fermare, se non in una
fotografia.
Rosario
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
Questo codice contine errori di tutti i tipi, perche' non ho molta
fantasia a fare i test; chi lo usa lo fa a suo rischio e pericolo.
Struttura temporale
0 giorno 0..30 [+1 per ottenere il giorno corretto]
4 Mese 0..11 [+1 per ottenere il mese corretto]
8 anno ??..0..??
12 ore 0..23
16 minuti 0..59
20 secondi 0..59
24 mgmt -12*60..12*60 aggiustamento in minuti per raggiungere il meridiano
di greenech
-720..720 nel mio diario chi sono 12 fusorari da una parte e 11
dall'altra...
;;
<< giorno=0, mese=4, anno=8, ora=12, minuti=16, secondi=20, mgmt=24
; 0ra, 4P_a, 8P_sizeinbytes
align 4
Zero:
a=[s+4]|c=[s+8]
a==0#.e|c>0?#.1
.e: stc|#.z
.1: r^=r|c&=0FFFFFFFCh|#.3
.2: D[a+r]=0|r+=4
.3: r<c#.2
c=[s+8]|c&=3| =#.5| c+=r
.4: B[a+r]=0|++r
r<c#.4
.5: clc
.z:
ret 8
; int __stdcall DataOggi(Data* oggi)
; giorno,mese,anno,ora,minuti,secondi,gmt
; per errore ritorna -1 tutto ok ritorna 0
; 0Ra, 4P_Oggi + 128
; 1132
export DataOggi
align 4
DataOggi:
s-=1128
a=^1132|a==0#.e
r=-1|*a=r|*a+4=r|*a+8=r|*a+12=r|*a+16=r|*a+20=r|*a+24=r
a=s|GetLocalTime(a) |a=^1132|a==0#.e|c^=c|r^=r
#.1
.e: a=-1|stc| #.z
.1: rx=*s+ 6|cx=*s+ 2|--r,c |*a=r|*a+4=c ; giorno, mese
rx=*s |cx=*s+ 8|*a+8 =r|*a+12=c ; anno , ora
rx=*s+10|cx=*s+12|*a+16=r|*a+20=c ; minuti, secondi
a=s|GetTimeZoneInformation(a)|a==-1#.e|c=^0
a=^1132 |*a+24=c ; intero 32bit[anche negativo], fusorario
in minuti
a^=a ; nel caso italia => -60 minuti per
ottenere greenich
.z: ; dalla data corrente
s=&[s+1128]
ret 4
; int __stdcall DataOggiParziale(Data* oggi)
; giorno,mese,anno,ora,minuti,secondi ma non gmt
; per errore ritorna -1 tutto ok ritorna 0
; 0Ra, 4P_Oggi + 128
; 1132
export DataOggiParziale
align 4
DataOggiParziale:
s-=1128
a=^1132|a==0#.e
r=-1|*a=r|*a+4=r|*a+8=r|*a+12=r|*a+16=r|*a+20=r
a=s|GetLocalTime(a) |a=^1132|a==0#.e|c^=c|r^=r
#.1
.e: a=-1|stc| #.z
.1: rx=*s+ 6|cx=*s+ 2|--r,c |*a=r|*a+4=c ; giorno, mese
rx=*s |cx=*s+ 8|*a+8 =r|*a+12=c ; anno , ora
rx=*s+10|cx=*s+12|*a+16=r|*a+20=c ; minuti, secondi
a^=a
.z:
s=&[s+1128]
ret 4
; i32 __stdcall DaiGmt(void)
; giorno,mese,anno,ora,minuti,secondi,gmt
; 0Ra, 4P_Oggi + 128
; 1132
export DaiGmt
align 4
DaiGmt:
s-=1128
#.1
.e: a=-1|stc|#.z
.1: a=s |GetTimeZoneInformation(a)|a==-1#.e|a=^0
a>720?#.e|a< -720?#.e|clc
.z:
s=&[s+1128]
ret
;RiempiGmt(u32* data)
;0ra, 4P_data
export RiempiGmt
align 4
RiempiGmt:
DaiGmt()|jc .e
r=^4|r==0#.e|*r+mgmt=a|clc|#.z
.e: a=-1|stc|#.z
.z:
ret 4
; InserisciTime(u32* data, u32 giorno, u32 mese, u32 anno, u32 ora, u32 min, u32
sec, u32 gmt)
;giorno=0, mese=4, anno=8, ora=12, minuti=16, secondi=20, mgmt=24
;0ra,4P_data, 8P_giorno,12P_mese,16P_anno, 20P_ora,24P_min,28P_sec, 32P_gmt
export InserisciTime
align 4
InserisciTime:
a=^4|a==0#.e|#.1
.e0: a=^4|r=-1|*a=r|*a+4=r|*a+8=r |*a+12=r|*a+16=r|*a+20=r|*a+24=r
.e: a=-1|stc|#.z
.1: r=^8 |--r|*a+giorno=r
r=^12|--r|*a+mese =r
r=^16| *a+anno =r
r=^20| *a+ora =r
r=^24| *a+minuti=r
r=^28| *a+secondi=r
r=^32| *a+mgmt =r
IsData(a)|jc .e0
.z:
ret 32
;InserisciData(u32* data, u32 giorno, u32 mese, u32 anno)
;giorno=0, mese=4, anno=8, ora=12, minuti=16, secondi=20, mgmt=24
;0j,4i,8ra,12P_data, 16P_giorno,20P_mese,24P_anno
export InserisciData
align 4
InserisciData:
<i,j
;iint3
j=^12|j==0#.e|#.1
.e0: r=-1|*j=r|*j+4=r|*j+8=r |*j+12=r|*j+16=r|*j+20=r |*j+24=r
.e: a=-1 |stc|#.z
.1: r=^16|--r|r>30#.e0|*j+giorno=r
r=^20|--r|r>11#.e0|*j+mese =r
r=^24| *j+anno =r
IsLeap(r)|a==1!#.2|i=daytabL|#.3
.2: i=daytab
.3: a^=a|c=*j+mese |al=*i+c|*j+giorno>=a#.e0
DaiGmt()|jc .e0|*j+mgmt=a
a^=a
.z:
>i,j
ret 16
;InserisciOra(u32* data, u32 ora, u32 min, u32 sec)
;giorno=0, mese=4, anno=8, ora=12, minuti=16, secondi=20, mgmt=24
;0ra,4P_data, 8P_ora,12P_min,16P_sec
export InserisciOra
align 4
InserisciOra:
a=^4 |a==0#.e|#.1
.e0: a=^4 |r=-1|*a=r|*a+4=r|*a+8=r |*a+12=r|*a+16=r|*a+20=r|*a+24=r
.e: a=-1 |stc|#.z
.1: r=^8 |r>=24#.e0|*a+ora =r
r=^12|r>59 #.e0|*a+minuti =r
r=^16|r>59 #.e0|*a+secondi=r
a^=a
.z:
ret 16
;InserisciGmt(u32* data, u32 gmt)
;giorno=0, mese=4, anno=8, ora=12, minuti=16, secondi=20, mgmt=24
;0ra,4P_data, 8P_gmt
export InserisciGmt
align 4
InserisciGmt:
a=^4|a==0#.e|#.1
.e0: a=^4|r=-1|*a=r|*a+4=r|*a+8=r |*a+12=r|*a+16=r|*a+20=r|*a+24=r
.e: a=-1|stc|#.z
.1: r=^8|r>720?#.e0|r< -720?#.e0|*a+mgmt=r
a^=a
.z:
ret 8
the only dipendence by os are the functions
'kernel32.GetLocalTime'
'kernel32.GetTimeZoneInformation'
for get the local time and the time difference in minutes from
Greeniech [but possibily i not understat that, for example here
in this post will appear Date: Sat, 9 Apr 2011 00:33:44 +0200
but the difference in minutes is -60 minutes so
+0200 what does it mean?]
> i mean the .dll posted with the file that is not C,
> but the output of one version of RosAsm + the macro
> language i use [macro2d]
> don't know if you consider it assembly; sure it is not
> C or C++ or whatherver other know language.
> the C++ code is just for debug, if i would like
> to use the functions in that way possibly,
> on error, i would zero all the date result
> even if from that could follow very long loops...
> in that .dll if somoene open it with RosAsm
> there is something begin with
> PREPARSE MACRO2D
> %define GetLocalTime 'kernel32.GetLocalTime'
> %define GetTimeZoneInformation 'kernel32.GetTimeZoneInformation'
> section data
> hInstance dd 0, 0
I use RosAsm sometimes rare, but I never use Macros.
[...]
> mesiIta dd mes0, mes1, mes2, mes3, mes4, mes5, mes6, mes7, mes8, mes9,
...
Just to keep everthing smaller, faster and a bit smarter,
I made my date/time data formats not that flexible as you do,
so I contentate similar strings on the fly:
MOV eax,"0day" ;mov eax,79616430h
... ;ie: [nr] = 06h
OR al,[nr] ;eax = "6day"
...
ROR eax,8 ;eax = "day6"
[...]
> the only dipendence by os are the functions
> 'kernel32.GetLocalTime'
> 'kernel32.GetTimeZoneInformation'
> for get the local time and the time difference in minutes from
> Greeniech [but possibily i not understat that, for example here
> in this post will appear Date: Sat, 9 Apr 2011 00:33:44 +0200
> but the difference in minutes is -60 minutes so
> +0200 what does it mean?]
This +0200 are the US-military way to tell: "two hours more" :)
I live in Vienna and my OS reports GMT+01:00 (West European Summer).
Italy got GMT+02:00 ? perhaps you didn't activate summertime ?
__
wolfgang
and just checked the header of my last post and it also says GMT+02:00.
So it must be something in Usenet which isn't aware of summer-time and
therefore off by one hour for half a year! :)
__
wolfgang
>
> I replied to Rosario...
> ...
>> I live in Vienna and my OS reports GMT+01:00 (West European Summer).
Well, then somebody has misconfigured your OS. West European Summer Time is
used in Portugal and Ireland. Vienna should currently be in Central
European Summer Time (GMT +0200).
>> Italy got GMT+02:00 ? perhaps you didn't activate summertime ?
>
> and just checked the header of my last post and it also says GMT+02:00.
> So it must be something in Usenet which isn't aware of summer-time and
> therefore off by one hour for half a year! :)
The "+0200" is difference from GMT, and GMT does not have a notion of
summer-time. This means most of West Europe has +0100 in winter and +0200
in summer. England, Ireland, Portugal have +0000 and +0100 respectively.
Cheers
Paavo
>> I replied to Rosario...
>> ...
>>> I live in Vienna and my OS reports GMT+01:00 (West European Summer).
> Well, then somebody has misconfigured your OS. West European Summer Time
> is
> used in Portugal and Ireland. Vienna should currently be in Central
> European Summer Time (GMT +0200).
I see, it's just a windoze issue ... the clock headline reports GMT+01:00
but the shown time is correct, seems it handles the summertime apart.
At least the displayed- and the net-time is reported correct, even the
line where it tells 'western european summertime' is misleading.
[snipped my wrong assumption]
> The "+0200" is difference from GMT, and GMT does not have a notion of
> summer-time. This means most of West Europe has +0100 in winter and +0200
> in summer. England, Ireland, Portugal have +0000 and +0100 respectively.
Thanks for the hint where the border between Western and Central Time is.
__
wolfgang
<snip italian>
> Do you like my implementation of STL, vector like in asm? :)
STL? some C++ thing?
> Afther i wrote some routine i understood is better use
> \0 terminated strings, and easier routines.
>
> So i should not use the routines below in my hobby code.
> Only one of these routine pass a full test
> some other has some debug session for see if they are ok
> some other only i write down whitout any run.
>
> Do you like how i comment functions?
> Are them with too few comments?
> What about the library lay out?
> to me it seems very good...
> the first u32 for the space of the pointer
> the sys use for the multithread
> the other u32 one pointer to a struct
> that define the array[or the list, or some other]...
>
> ;;
> Array dinamici
> v:
> 0: u32 Riservato All'utente [per esempio per il multithread]
> 4: u32* PuntatoreAstructA
> Size=8u8
why are you posting vast screeds of assembler to comp.lang.c?
<snip>
He's been asked this numerous times before, and has never provided a
satisfactory answer. The solution is left as an exercise for your
killfile.
<snip italian>
> Do you like my implementation of STL, vector like in asm? :)
@STL? some C++ thing?
yes
...
> ;;
> Array dinamici
> v:
> 0: u32 Riservato All'utente [per esempio per il multithread]
> 4: u32* PuntatoreAstructA
> Size=8u8
@why are you posting vast screeds of assembler to comp.lang.c?
Why?
-show with one example that assembly is better,
easier, than C or C++
at last in some part of programming area
-show jumps and goto in assembly are better than
loops and ifs in high level languages
-show pointers are *very good* and not something
to not use
-show functions can be ok [at last for me]
without the use of prototipes
-allow C or C++ to use asm function in the way
*the caller has to check if the asm function return error*
@<snip>
Do not have to fear,
the time library is the last example [i posted it because it was
small and not use many other functions, very good as example]
and i will not continue to post library examples...
i hope to not hurt all you and the NGs too much...
i'm not should be sure 100% of what i say,
but it seems that to me!
have a good day
> I live in Vienna and my OS reports GMT+01:00 (West European Summer).
> Italy got GMT+02:00 ? perhaps you didn't activate summertime ?
Really? GMT is obsolete outside Great Britain.
(sort of obsolete inside, but not dead yet)
Replaced by UTC. Heck, the Royal Observatory, Greenwich
was shut down years ago.
--
Michael Press
Well it would be if the French had their way...
> (sort of obsolete inside, but not dead yet)
> Replaced by UTC. Heck, the Royal Observatory, Greenwich
> was shut down years ago.
Really? It was still there last time I looked.
http://www.nmm.ac.uk/places/royal-observatory/
--
Ian Collins
> On 04/14/11 09:25 AM, Michael Press wrote:
> > In article<inrmji$a84$1...@newsreader2.utanet.at>,
> > "wolfgang kern"<now...@never.at> wrote:
> >
> >> I live in Vienna and my OS reports GMT+01:00 (West European Summer).
> >> Italy got GMT+02:00 ? perhaps you didn't activate summertime ?
> >
> > Really? GMT is obsolete outside Great Britain.
>
> Well it would be if the French had their way...
`GMT' is avoided in technical contexts.
UTC replaced GMT as the main time scale yonks ago.
> > (sort of obsolete inside, but not dead yet)
> > Replaced by UTC. Heck, the Royal Observatory, Greenwich
> > was shut down years ago.
>
> Really? It was still there last time I looked.
>
> http://www.nmm.ac.uk/places/royal-observatory/
The buildings are there, but a museum.
Furthermore, the prime meridian is 102.5 m
west of the Greenwich meridian.
--
Michael Press
Probably somewhere in this thread:
http://groups.google.com/group/comp.lang.c/browse_thread/thread/c3af688e335f180f
If your newsgroups server filters out posts that contain profane
words, it would have deleted many of the posts in this thread.