🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.arch
Article #2463

Using C as an aid to hand writing assembler

#2463
From: Roy Smith
Date: Tue, 06 May 1986 22:54
34 lines
1715 bytes
In article <399@ccird1.UUCP> rb@ccird1.UUCP (Rex Ballard) writes:
> [...] C was written for PDP-11s, as sort of a GENERIC ASSEMBLER.  When
> reduced to it's simplest constructs, that is exactly what C is.

	Some years ago when I was learning 6800 assembler (anybody remember
D2 kits?) I used to first write everything in C and then hand compile it
into M6800 asm.  When I told my professor (are you reading this Professor
Efe?) that I did this instead of drawing flow-charts, he laughed at me, but
as long as you keep your code simple, the conversion is trivial and can be
done in your head as fast as you can write down the asm code.  Perhaps the
simplicity of the M6800 (dare I call it a RISC machine? :-)) makes this
easier than for something like a vax, but I can still do it; let's see:

	char i, j;
	j = 0;
	for (i = 0; i <= 10; i++)
	        j = j + i;

	clr	j
loop1:  clr	i
	cmp	i, #10
	bge	out
	lda	j
	adda	i
	sta	j
	lda	i
	inca
	sta	i
	bra     loop1:
out:
-- 
Roy Smith, {allegra,philabs}!phri!roy
System Administrator, Public Health Research Institute
455 First Avenue, New York, NY 10016
Technical Details
Message-ID: <2336@phri.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!phri!roy
References: <817@harvard.UUCP> <Navajo.494> <460@cubsvax.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!philabs!cmcl2!phri!roy
From: roy@phri.UUCP (Roy Smith)
Newsgroups: net.arch
Subject: Using C as an aid to hand writing assembler
Message-ID: <2336@phri.UUCP>
Date: Tue, 6-May-86 18:54:11 EDT
Article-I.D.: phri.2336
Posted: Tue May  6 18:54:11 1986
Date-Received: Thu, 8-May-86 20:43:47 EDT
References: <817@harvard.UUCP> <Navajo.494> <460@cubsvax.UUCP>
Reply-To: roy@phri.UUCP (Roy Smith)
Organization: Public Health Research Inst. (NY, NY)
Lines: 34
Original-Subject: Re: Arch support for C