6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 3:18 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: 6502 Vs. Z80
PostPosted: Sat Jul 27, 2013 5:46 pm 
Offline
User avatar

Joined: Wed Jul 10, 2013 3:13 pm
Posts: 67
Applesoft Basic
Code:
REM If the printer is in expansion slot 1
PR#1
PRINT "Printer Test"


ZX Spectrum Basic
Code:
LPRINT "Printer Test"


what are the pros and cons of each

_________________
JMP $FFD2


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 Vs. Z80
PostPosted: Sat Jul 27, 2013 6:06 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8544
Location: Southern California
The BASIC language is mostly unrelated to the processor underneath. They could have made the syntax, I/O setup, etc. any way they wanted for either processor.

From a recent email I sent a nephew who wants to get into programming:
Quote:
Since processors only run their own machine language, higher-level languages (e.g., BASIC, C, Pascal, etc.) have to be either interpreted or compiled. If interpreted, the instructions are decoded at runtime by a machine-language program. If compiled, the instructions are figured out at compile time, producing either a machine-language program to run, or a list of addresses of machine-language routines to run. (Obviously then the compiled one will run faster than the interpreted one.) A compiler is a piece of software similar to an assembler, but produces processor-usable code out of a higher-level language instead of out of assembly language.

The topic at viewtopic.php?t=18 turned into a discussion on 6502 v. Z80 about 1/3 to 1/2 of the way down the first page.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 Vs. Z80
PostPosted: Wed Jul 31, 2013 5:22 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
The Apple version is interesting in that there is no special command for printer output. PR#1 redirects all output to whatever device is in slot 1, usually the printer card. You can use the same code to output text to any device - modem, screen, etc., kind of like output redirection on modern systems.

LPRINT on the ZX is restricted specifically to the printer device, for that one statement only.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 Vs. Z80
PostPosted: Thu Aug 01, 2013 2:44 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
enso wrote:
The Apple version is interesting in that there is no special command for printer output. PR#1 redirects all output to whatever device is in slot 1, usually the printer card. You can use the same code to output text to any device - modem, screen, etc., kind of like output redirection on modern systems.

LPRINT on the ZX is restricted specifically to the printer device, for that one statement only.

BASIC as implemented on the 8 bit Commodore computers also didn't have any special command for printer output. In order to print to a printer it was first necessary to open a file to the desired printer's device number (up to 4 printers could be supported). The BASIC PRINT# verb was then used to direct output into that file, which would eventually appear on the printer.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 Vs. Z80
PostPosted: Thu Aug 01, 2013 6:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
BBC basic too uses the OS redirection of input and output.


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 Vs. Z80
PostPosted: Fri Aug 02, 2013 5:06 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
BigEd wrote:
BBC basic too uses the OS redirection of input and output.

Funny how UNIXy things like I/O redirection pop up in all sorts of places. :D

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: