<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[atari.area forum - wirtualny procesor - z80 emulator]]></title>
		<link>https://www.atari.org.pl/forum/viewtopic.php?id=4922</link>
		<atom:link href="https://www.atari.org.pl/forum/extern.php?action=feed&amp;tid=4922&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Najświeższe odpowiedzi w wirtualny procesor - z80 emulator.]]></description>
		<lastBuildDate>Thu, 19 Apr 2007 11:06:58 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[wirtualny procesor - z80 emulator]]></title>
			<link>https://www.atari.org.pl/forum/viewtopic.php?pid=68238#p68238</link>
			<description><![CDATA[<p>Witam,</p><p>napisalem emulator procesora z80 na kanwie ktorego uruchomilem zx spectrum emulator (w innym watku i na atari.online.pl mozna zobaczyc jak dzialaja gry z zx spectrum uruchomione na tym emulcu) obecnie chcialbym opublikowac emulator z80 w najwygodniejszej dla userow formie (oczywiscie mozna go extractowac z tych gier ale&nbsp; sa wygodniejsze metody - publikacja).</p><p>moja propozycja:<br />- z80 emulator jako osobny programik (wielkosc ok. 3 kb razem z tablicami)<br />- biblioteka rozkazow (osobno, poniewaz mozna emulowac inny niz z80 procesor)</p><p>emulator z80 posiada tablice skokow zawierajaca:<br />- procedure uruchomienia z80 (run_z80).<br />- procedure powrotu z trybu z80</p><p>&nbsp; &nbsp; &nbsp; przyklad1:</p><p>&nbsp; &nbsp; &nbsp; lda #0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; program 6502<br />&nbsp; &nbsp; &nbsp; jsr run_z80&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; uruchomienie z80<br />&nbsp; &nbsp; &nbsp; xor a&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; program z80<br />&nbsp; &nbsp; &nbsp; ld (colbaks),a<br />&nbsp; &nbsp; &nbsp; ret&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; makro $dd,$01 powrot do trybu 6502<br />&nbsp; &nbsp; &nbsp; ldy #0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; program 6502</p><p>&nbsp; &nbsp; &nbsp; przyklad2:</p><p>&nbsp; &nbsp; &nbsp; lda &lt;_z&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; program 6502<br />&nbsp; &nbsp; &nbsp; ldx &gt;_z&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; wartosci dla pc procesora z80<br />&nbsp; &nbsp; &nbsp; jmp run_z80&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; uruchomienie z80<br />_6&nbsp; lda #0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; </p><p>_z&nbsp; &nbsp;xor a&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; program z80<br />&nbsp; &nbsp; &nbsp; ld (colbaks),a<br />&nbsp; &nbsp; &nbsp; jp _6&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; makro $dd,$02 powrot do trybu 6502</p><p>roznica jest taka, ze w pierwszym przykladzie nastapi korekta pc procesora 6502, tak ze po powrocie z trybu z80 program bedzie wykonywany od kolejnego rozkazu (tym razem juz rozkazu 6502)</p><p>- procedury dodawania/aktualizacji rozkazow emulowanego procesora<br />- procedury aktualizacji pc emulowanego procesora</p><p>przyklad:<br />&nbsp; &nbsp; &nbsp; ldy #$12&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; kod rozkazu LD (de),a procesora z80<br />&nbsp; &nbsp; &nbsp; lda &lt;_z&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; ldx &gt;_z&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;; adres procedury obslugi rozkazu<br />&nbsp; &nbsp; &nbsp; jsr update_z80&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; <br />_z&nbsp; &nbsp;ldy #0<br />&nbsp; &nbsp; &nbsp; lda z80_a<br />&nbsp; &nbsp; &nbsp; sta (z80_de),y<br />&nbsp; &nbsp; &nbsp; jmp z80_pc_plus1</p><p>i wlasnie zdefiniowalismy nowy rozkaz zapisujacy zawartosc akumulatora z80 do pamieci pod adresem wskazywanym przez pare rejestrow de proca z80, jesli masz 65816 zdefiniujesz sobie rozkazy korzystajac <br />z jego mozliwosci</p><p>procedur update jest 5 dla rozkazow zwyklych, i z prefiksami fd,dd,ed,cb (oczywiscie prefiksy tez mozemy zmieniac)</p><p>procedury aktualizacji pc z80 o 1,2,3 i 4 bajty</p><p>czy to wystarczy? jakies uwagi?</p><br /><p>-- edit<br />sa dwie procedury aktualizacji pc: o 1 bajt i o ilosc bajtow zawarta w akumulatorze - to uklon w strone makrorozkazow.</p>]]></description>
			<author><![CDATA[null@example.com (xxl)]]></author>
			<pubDate>Thu, 19 Apr 2007 11:06:58 +0000</pubDate>
			<guid>https://www.atari.org.pl/forum/viewtopic.php?pid=68238#p68238</guid>
		</item>
	</channel>
</rss>
