Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: Hex Kategorie: Programmierung Basic (von Windt H.J. - 3.02.2006 0:30)
 Als Antwort auf Re: Hex von Achim - 2.02.2006 23:34
Hello,
Thanks Achim, IÂ’ll be the first to admit that you are correct! ;)
Your idea also gave me a new idea, have a look.
It looks a lot “cleaner” this way.
Thanks again,
H.J. Windt

define nr byte[1]
define temp byte[2]
define variable word[2]

for nr = 0 to 5
looktab cheksum, nr, variable
gosub print_hex
next
end

#print_hex
put &h26 : put &h68
temp = (variable and 61440) shr 12 : if temp < 10 then put temp + &h30 else put temp + &h37
temp = (variable and 3840) shr 8 : if temp < 10 then put temp + &h30 else put temp + &h37
temp = (variable and 240) shr 4 : if temp < 10 then put temp + &h30 else put temp + &h37
temp = (variable and 15) : if temp < 10 then put temp + &h30 else put temp + &h37
print""
return

Table cheksum &H64 &H65 &H66 &H67 &HFFFF &hA
tabend

 Antwort schreiben

Bisherige Antworten:

Re: Hex (von Achim - 3.02.2006 11:13)
    Re: Hex (von Windt H.J. - 4.02.2006 18:09)
Re: Hex (von Michael - 3.02.2006 8:37)