Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Buon Natale

0 views
Skip to first unread message

io_x

unread,
Dec 23, 2009, 12:12:08 PM12/23/09
to
Buon Natale

Merry Christmas to all!

Nathan Baker

unread,
Dec 23, 2009, 8:53:44 PM12/23/09
to
"io_x" <a...@b.c.invalid> wrote in message
news:4b324d9b$0$816$4faf...@reader5.news.tin.it...

> Buon Natale
>
> Merry Christmas to all!
>

Merry Christmas and a Happy New Year!

Nathan.


Herbert Kleebauer

unread,
Dec 24, 2009, 3:00:18 PM12/24/09
to
io_x wrote:
>
> Buon Natale
>
> Merry Christmas to all!

Sorry, there must be a bug. Your code crashes when I execute it.
Here a working version (maybe you should use an assembler
with a more logical syntax):


@=$100
dc.b "Merry Christmas and a Happy New Year!"
dc.b "$VZ500599"
trap #$21
rts.w


The hexdump of the binary:

4d65727279204368726973746d617320616e64206120486170
7079204e657720596561722124565a353030353939cd21c3

Alexei A. Frounze

unread,
Dec 24, 2009, 4:29:37 PM12/24/09
to

No, he just didn't include the macro definitions. :)
And neither will I:

¡Feliz Navidad!
С Рождеством!

Alex

io_x

unread,
Dec 25, 2009, 12:52:07 PM12/25/09
to

"Herbert Kleebauer" <kl...@unibwm.de> ha scritto nel messaggio
news:4B33C852...@unibwm.de...
> io_x wrote:
the traslation
------------------
org 100h
main:
push si
mov ah, 0Eh
mov si, auguri
.1: mov al, [si]
cmp al, 0
je .2
inc si
int 10h
jmp short .1
.2: mov ax, 0
pop si
ret
auguri db "Auguri di Buon Natale, e di un felice "
db "anno nuovo!" , 13, 10
db "Merry Christmas and a Happy New Year!"
db 13, 10, 0, 0
-------------
origin
-----------------
org 100h
main:
<i |ah=0Eh|i=auguri
.1: al= *i|al==0#.2|++i|int 10h|#.1
.2: a=0
>i
ret
auguri db "Auguri di Buon Natale, e di un felice "
db "anno nuovo!", 13, 10
db "Merry Christmas and a Happy New Year!"
db 13, 10, 0, 0

Herbert Kleebauer

unread,
Dec 26, 2009, 4:12:50 AM12/26/09
to
io_x wrote:
> "Herbert Kleebauer" <kl...@unibwm.de> ha scritto nel messaggio

> the traslation


> ------------------
> org 100h
> main:
> push si
> mov ah, 0Eh
> mov si, auguri
> .1: mov al, [si]
> cmp al, 0
> je .2
> inc si
> int 10h
> jmp short .1
> .2: mov ax, 0
> pop si
> ret
> auguri db "Auguri di Buon Natale, e di un felice "
> db "anno nuovo!" , 13, 10
> db "Merry Christmas and a Happy New Year!"
> db 13, 10, 0, 0

Displaying a text string on the screen is a beginners works.
The greetings are meant for the CPU and not for a lazy
human sitting before the screen. The CPU does all the
hard work all the day and deserves some greetings. In my
code "Merry Christmas and a Happy New Year!" is not some
data string written to the screen but executed as code by
the CPU byte by byte.


PS: And the CPU really deserves some greetings if it
accepts such a syntax without a word of protest:

wolfgang kern

unread,
Dec 26, 2009, 5:53:00 AM12/26/09
to

"Herbert Kleebauer" <kl...@unibwm.de> schrieb im Newsbeitrag
news:4B33C852...@unibwm.de...

> io_x wrote:
>>
>> Buon Natale
>>
>> Merry Christmas to all!
>
> Sorry, there must be a bug. Your code crashes when I execute it.
> Here a working version (maybe you should use an assembler
> with a more logical syntax):
>
>
> @=$100
> dc.b "Merry Christmas and a Happy New Year!"
> dc.b "$VZ500599"
> trap #$21
> rts.w
>
>
> The hexdump of the binary:

I try to interprete it out from my head:
(assume a 16-bit .com)

0100 4d dec bp ;M
0101 65 72 72 gs: jc 0176 ;err ;if carry wasn't set
0104 79 20 jns 0126 ;y[] ;andif bp was >0 ...
0106 43 inc bx ;C
0107 68 72 69 push 6972 ;hri
010a 73 74 jnc 0180 ;st
010c 6d insw ;m
010d 61 popa ;a
010e 73 20 jnc 0130 ;s[]
0110 61 popa ;a
0111 6e outsb ;n
0112 64 20 61 20 and fs:[bx+di+20],ah ;d[]a[]
0116 48 dec ax ;H
0117 61 popa ;a
0118 70 70 jo 18a ;pp
011a 79 20 jns 13c ;y[]
011c 4e dec di ;N
011d 65 77 20 gs: ja 0140 ;ew[]
0120 59 pop cx ;Y
0121 65 61 gs: popa ;ea
0123 72 21 jc 0146 ;r!
0125 24 (56) and al,56 ;$(V)
:126 56 push di ;V ;...then it might come here
0127 5a pop dx ;Z ;DS=PSP+0100, dx= 0 now ?
0128 35 30 30 xor ax,3030 ;500
012b 35 39 39 xor ax,3939 ;599 ;ah= 09 yet ?
012e cd 21 int 21 ;
:130 c3 ret ;

ASCII-decoding is kinda fun, Happy New Year!

__
wolfgang


io_x

unread,
Dec 27, 2009, 2:30:23 AM12/27/09
to

"Herbert Kleebauer" <kl...@unibwm.de> ha scritto nel messaggio
news:4B35D392...@unibwm.de...

> io_x wrote:
> PS: And the CPU really deserves some greetings if it
> accepts such a syntax without a word of protest:

i like what is easy [for me], and loops

Frank Kotler

unread,
Dec 27, 2009, 2:14:03 PM12/27/09
to
Herbert Kleebauer wrote:
...

> PS: And the CPU really deserves some greetings if it
> accepts such a syntax without a word of protest:

Right! Everybody knows an x86 CPU prefers Motorola syntax! Oh, wait...

Best,
Frank

Herbert Kleebauer

unread,
Dec 28, 2009, 8:23:42 AM12/28/09
to

It doesn't matter what "everybody" knows. It only matters what the
CPU thinks. Just ask your CPU yourself. But you have to do this in
an OS which allows the CPU to give an uncensored answer (real mode
DOS instead of protected mode Linux). I have converted the question
to NASM syntax, so go ahead and feed the question to the CPU and
read it's answer.

nasm askcpu.asm -o askcpu.com

org $100
db "Isn't the Motorola syntax much superior to the Intel syntax? ",13,10
db "I suppose, there is no doubt about your answer. ",13,10
db "VX4$, 0D',u,uPZ511599"
int $21
ret

Frank Kotler

unread,
Dec 29, 2009, 6:40:57 PM12/29/09
to

Well, the wind blew and the power went out, so I had a chance to boot
dos and try this. Even trickier than it appears! In DEBUG, it waits for
a key and doesn't print anything! I'll have to study this... Thanks,
Herbert!

Best,
Frank

io_x

unread,
Jan 2, 2010, 1:37:31 AM1/2/10
to

"Herbert Kleebauer" <kl...@unibwm.de> ha scritto nel messaggio
news:4B33C852...@unibwm.de...

> io_x wrote:
>>
>> Buon Natale
>>
>> Merry Christmas to all!
>
> Sorry, there must be a bug. Your code crashes when I execute it.

yes possibily i'm not much sure on "ah=0Eh|int 10h"

> Here a working version (maybe you should use an assembler
> with a more logical syntax):

this below here not segfault, and print the strings in a cmd window
where "bcc32" is the Borland C and C++ compiler 32bit
-------------------------------------------
; nasmw -fobj this.asm
; bcc32 -v this.obj
section _DATA use32 public class=DATA
global _main
extern _printf
fmt db "%c" , 0, 0


auguri db "Auguri di Buon Natale, e di un felice "
db "anno nuovo!" , 13, 10
db "Merry Christmas and a Happy New Year!"
db 13, 10, 0, 0

section _TEXT use32 public class=CODE
_main:
pushad
mov esi, auguri
xor ebx, ebx
.1: mov bl, [esi]
cmp ebx, 0
je .2
push ebx
push fmt
call _printf
add esp, 8
cmp eax, 1
jne .2
inc esi
jmp short .1
.2:
popad
mov eax, 0
ret
--------------------
; nasmw -fobj this.asm
; bcc32 -v this.obj
section _DATA use32 public class=DATA
global _main
extern _printf
fmt db "%c", 0, 0


auguri db "Auguri di Buon Natale, e di un felice "
db "anno nuovo!", 13, 10
db "Merry Christmas and a Happy New Year!"
db 13, 10, 0, 0

section _TEXT use32 public class=CODE
_main:
pushad
i=auguri|b^=b
.1: bl=*i|b==0#.2
_printf<(fmt, b)|a!=1#.2
++i|#.1
.2:
popad
a=0
ret
--------------------

Herbert Kleebauer

unread,
Jan 3, 2010, 3:57:47 AM1/3/10
to
io_x wrote:
> "Herbert Kleebauer" <kl...@unibwm.de> ha scritto nel messaggio

> > io_x wrote:


> >>
> >> Buon Natale
> >>
> >> Merry Christmas to all!
> >
> > Sorry, there must be a bug. Your code crashes when I execute it.
>
> yes possibily i'm not much sure on "ah=0Eh|int 10h"

I didn't say your code but your greetings crashes when executed.

When I disassemble the text:

------------------------------------------
Buon Natale

Merry Christmas to all!
------------------------------------------

I get:

0100 inc.w r1 (42)
0101 bne.b $0172 (75 6f)
0103 out.b (r5.w)+-,r1 (6e)
0104 and.b r2,$61(r4.w){s7} (20 4e 61)
0107 beq.b $016a (74 61)
0109 in.b r1,(r6.w)+-{s1} (6c)
010a or.w #$0d0a,r0 (65 0d 0a 0d)
010e or.b $65(r6.w),r2 (0a 4d 65)
0111 bcs.b $0185 (72 72)
0113 bpl.b $0135 (79 20)
0115 inc.w r3 (43)
0116 move.w #$6972,-(sp) (68 72 69)
0119 bcc.b $018f (73 74)
011b in.w r1,(r6.w)+-{s1} (6d)
011c movem.w (sp)+,r0-r7 (61)
011d bcc.b $013f (73 20)
011f beq.b $0190 (74 6f)
0121 and.b m0,$6c(r3.w,r6.w) (20 61 6c)
0124 in.b r1,(r6.w)+-{s1} (6c)
0125 and.w r0,(r3.w,r5.w) (21 00)

And because your greetings doesn't specify any code at
address 0x0172, the processor executes what ever is
left there.

io_x

unread,
Jan 4, 2010, 4:17:41 AM1/4/10
to

"Herbert Kleebauer" <kl...@unibwm.de> ha scritto nel messaggio
news:4B405C0B...@unibwm.de...
if at that address i specify:
(si==100, bp==09xx)
00000072 55 push bp ; U
00000073 58 pop ax ; X
00000074 56 push si ; V
00000075 5A pop dx ; Z
00000076 53 push bx ; S (not used)
00000077 CD21 int 0x21 ; �! here ah=09h dx==0100h
00000079 53 push bx ; S (not used)
0000007A CD20 int 0x20 ; �
0000007C 21 db 0x21 ; ! (not used)
it would print the string until $; (but not using debug program)
it seems all right if this below is find in a .com file
--------------------
Buon Natale e un felice anno nuovo!
Merry Christmas and one Happy New Year!
thanks to CPU x86 and all you too
$UXVZS�!S� !


io_x

unread,
Jan 5, 2010, 2:34:46 AM1/5/10
to

"io_x" <a...@b.c.invalid> ha scritto nel messaggio
news:4b41b05a$0$1143$4faf...@reader1.news.tin.it...

>> And because your greetings doesn't specify any code at
>> address 0x0172, the processor executes what ever is
>> left there.
> if at that address i specify:
> (si==100, bp==09xx)
> 00000072 55 push bp ; U
> 00000073 58 pop ax ; X
> 00000074 56 push si ; V
> 00000075 5A pop dx ; Z
> 00000076 53 push bx ; S (not used)
> 00000077 CD21 int 0x21 ; �! here ah=09h dx==0100h
> 00000079 53 push bx ; S (not used)
> 0000007A CD20 int 0x20 ; �
> 0000007C 21 db 0x21 ; ! (not used)
> it would print the string until $; (but not using debug program)
> it seems all right if this below is find in a .com file
> --------------------
> Buon Natale e un felice anno nuovo!
> Merry Christmas and one Happy New Year!
> thanks to CPU x86 and all you too
> $UXVZS�!S� !

---------------------


Buon Natale e un felice anno nuovo!
Merry Christmas and one Happy New Year!

Thanks to CPU x86 and all you too
$CLARA_LUX_VZ._S�!S� !


0 new messages