|
Wordle 1,083 3/6*
⬛🟩⬛⬛🟨
⬛🟩🟨🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,083 3/6
⬜🟩⬜⬜🟨
⬜🟩⬜🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
Wordle 1,083 4/6*
⬜🟨⬜⬜🟨
🟨⬜⬜🟩🟩
⬜⬜🟨🟩🟩
🟩🟩🟩🟩🟩
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Wordle 1,083 3/6
⬜⬜⬜🟨🟨
🟨⬜⬜🟩🟩
🟩🟩🟩🟩🟩
|
|
|
|
|
This might be interesting.
Background
I'm learning RISC-V assembly and I've written an article (here on CP) on how to run a RISC-V-based version of Debian via QEMU on your machine.
You can run QEMU on Windows, Mac or Linux and then emulate the RISC-V-based Debian on any of those systems. QEMU emualtion is fairly lightweight and very cool. The android emulator, for example, runs via QEMU.
It's a nice easy (safe) way to learn RISC-V Assembly.
The Main Story
I was thinking about how I'd also like to learn x86_64 Assembly on Windows because of this book, The Art of 64-Bit Assembly, Volume 1: x86-64 Machine Organization and Programming[^]
I'm on a Mac right now and I'm normally on a desktop running Ubuntu 22.04.4.
I started thinking, "Hey, can I emulate Windows / DOS in QEMU so I can run MASM and learn Assembly there?"
Nope! Not really.
I know I can run Windows via VirtualBox but wow, that is interesting that Microsoft OS is such a huge bloatware that you can't really run just a "command-line version" of it.
There are so many options with Linux that it really is amazing.
Also, I know I shouldn't even have thought of doing this bec "it's windows, after all", but just thought it was an interesting point that displays how different Windows v Linux really is.
EDIT UPDATE
And, of course, I can always learn x86_64 assembly on the Linux side and one of my top-5 all-time favorite authors updated his book on it recently: x64 Assembly Language Step-by-Step: Programming with Linux [^]
|
|
|
|
|
This reminds of an amusing story about emulation. This was quite some time ago but when I was in college a few friends wrote an emulator for the Control Data mainframe the school had. You could take programs written for the mainframe, which I believe was a 36-bit machine, and run them in their emulator with file and terminal I/O and just about everything. The funny part was their emulator running on an 80286 ran the programs faster than the actual machine did. We all get a good chuckle out of that.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Rick York wrote: their emulator running on an 80286 ran the programs faster than the actual machine did. We all get a good chuckle out of that.
Very cool! Devs can do amazing things when they are motivated.
Usually the motivation has nothing to do with managers, but instead some technical challenge that "can't be done".
|
|
|
|
|
I guess if you are bored or into sadomasochism you decide to learn assembly today. Pure C does it better. I recommend gardening with chainsaws or plowing with explosives. I'm messing with you... But to this day, the ONLY reason I can see injecting assembly into a code base is for a very, very special occasion - say a space craft on its way out of the solar system with 8k of ram.
History - my first and only assembly class was on, I $hit you not, an IBM 360 mainframe where 200+ of us delved into the mysteries of computer architecture. WTF is a stack, and why is it important? How do I code for a subroutine and maintain data? And on. After the vikings got done beating on us, the lights came on and we raped and pillaged their villages.
To this day, 40+ years later, I can visualize a stack and actually explain it to someone with a masters degree in CS. Mind you, this was all on punch cards and printouts. I was in engineering school - we were not allowed to use the terminals.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
charlieg wrote: ...if you are bored or into sadomasochism you decide to learn assembly... Naw, directly coding the hardware is cool.
There are no solutions, only trade-offs. - Thomas Sowell
A day can really slip by when you're deliberately avoiding what you're supposed to do. - Calvin (Bill Watterson, Calvin & Hobbes)
|
|
|
|
|
I know, I know
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
charlieg wrote: I guess if you are bored or into sadomasochism you decide to learn assembly today.
Yeah, I don't like pain much, but a little mental pain is ok, I guess.
I cannot find a reason to learn Assembly either, but I do have my excuses.
1. I will understand what is really happening better.
2. I work with some electronics components (embedded) so I just wondered what was possible if I better understand assembly.
Here's a very weird thing. I was reading the 1st ed. of C++ For Dummies (pub in 1994) the other day and I stumbled upon this quote:
"However, a register variable is not stored in memory but cached in a register of the processor. Becuase register variables are not in memory they have no address."
And then much later in the book...
"Null pointer assignment is Borland and Turbo C's way of telling you that you screwed up the the pointer and wrote to location 0 in the default data segment."
I read that book back in 1994 & had no idea what it was talking about.
Now that I'm learning Assembly and I've discovered the .data segment of my programs I know what it means. So, you can plainly see how important this is, I'm sure.
|
|
|
|
|
well like I said, having to do it slammed home the concept of pushing things on the stack. Once we got through the next few homework assignments, you could see the light bulbs coming on. Pushing and popping off the stack went from some sort of supernatural operation to an oh, of course. The classmates survived transformed it to a tool. Move forward 30+ years. Ask your next job candidate to explain stack operations, the difference between passing by pointer or reference, etc. Be prepared to watch their heads explode.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
follow up - yes sir, been there.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Completely agree.
C/C++ programmer really understands, how things are working, only having Assembly knowledge.
I am not writing Assembly, but Assembly knowledge helps me to write much better C/C++/C# code.
BTW, one practical Assembly usage in my work is debugging optimized code.
|
|
|
|
|
My takeaway from Microsoft is they have the best code editors and IDEs, but the worst environments and toolchains in terms of development.
Linux is all around a better all purpose development platform if you had to pick one.
The reason I main windows is because I can use WSL and WSA, plus I have a lot of apps that are windows only, but if i was strictly doing like, embedded dev I'd probably main linux.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
You can use DOS alone if you only want to learn x86 asm using MASM...
"If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization." ― Gerald Weinberg
|
|
|
|
|
I'm programming a 2D RPG game that uses an array of derived class instance pointers. For clarity I provide a code example in C++. I would like to sort the elements of the entities array based on the worldY value of each element.
main.cpp:
<pre lang="C++">
/*
* result:
* player
* object
* object
* npc
* npc
* 2 npc y: 30
* 1 npc y: 6
* 1 object y: 20
* 2 object y: 10
* player y: 0
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include "Entity.h"
#include "Npc.h"
#include "Player.h"
#include "Object.h"
int main()
{
Player* player = new Player();
std::vector<Entity*> objs;
std::vector<Entity*> npcs;
std::vector<Entity*> entities;
Entity* tmp = new OBJ_o();
objs.push_back(tmp);
objs.at(0)->worldY = 20;
objs.at(0)->ID = "1";
tmp = new OBJ_o();
objs.push_back(tmp);
objs.at(1)->worldY = 10;
objs.at(1)->ID = "2";
tmp = new NPC();
npcs.push_back(tmp);
npcs.at(0)->worldY = 6;
npcs.at(0)->ID = "1";
tmp = new NPC();
npcs.push_back(tmp);
npcs.at(1)->worldY = 30;
npcs.at(1)->ID = "2";
//--------------- update -------------------
player->update();
for (auto iter_objs = objs.begin(); iter_objs != objs.end(); ++iter_objs)
{
(*iter_objs)->update();
}
for (auto iter_npcs = npcs.begin(); iter_npcs != npcs.end(); ++iter_npcs)
{
(*iter_npcs)->update();
}
//-------------- entities --------------------
entities.push_back(player);
for (int i = 0; i < objs.size(); i++)
{
if (!objs.at(i)->name.empty())
{
entities.push_back(objs.at(i));
}
}
for (int i = 0; i < npcs.size(); i++)
{
if (!npcs.at(i)->name.empty())
{
entities.push_back(npcs.at(i));
}
}
// sort entities
std::sort(entities.begin(), entities.end());
//---------------- draw entities ------------------
for (auto iter = entities.begin(); iter != entities.end(); ++iter)
{
std::cout << (*iter)->ID << " ";
(*iter)->draw();
}
return 0;
}
Entity.h
#pragma once
#include <iostream>
class Entity
{
public:
int worldY = 0;
std::string name;
std::string ID;
public:
virtual void update() { std::cout << "base" << std::endl; }
virtual void draw() { std::cout << "base y: -\n"; }
bool operator<(const Entity& obj) const
{
return worldY < obj.worldY;
}
};
Npc.h
#pragma once
#include "Entity.h"
class NPC : public Entity
{
public:
NPC();
void update() override;
void draw() override;
};
Npc.cpp
#include "Npc.h"
#include <iostream>
NPC::NPC() { name = "npc"; }
void NPC::update() { std::cout << name << std::endl; }
void NPC::draw() { std::cout << "npc y: " << worldY << std::endl; }
Player.h
#pragma once
#include "Entity.h"
class Player : public Entity
{
public:
Player();
void update() override;
void draw() override;
};
Player.cpp
#include "Player.h"
#include <iostream>
Player::Player() { name = "player"; }
void Player::update() { std::cout << name << std::endl; }
void Player::draw() { std::cout << "player y: " << worldY << std::endl; }
Object.h
#pragma once
#include "Entity.h"
class OBJ_o : public Entity
{
public:
OBJ_o();
void update() override;
void draw() override;
};
Object.cpp
#include "Object.h"
#include <iostream>
OBJ_o::OBJ_o() { name = "object"; }
void OBJ_o::update() { std::cout << name << std::endl; }
void OBJ_o::draw() { std::cout << "object y: " << worldY << std::endl; }
(see result put as comment at the beginning of Main.cpp).
How should I do an increasing order of y (worldY) ?
Using:
std::sort(entities.begin(), entities.end());
I don't get the desired result:
player
object
object
npc
npc
player y: 0
1 npc y: 6
2 object y: 10
1 object y: 20
2 npc y: 30
|
|
|
|
|
Please read the red text a little bit above your post. It talks about how this is not the appropriate place for a post of this nature.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
As many people are about to tell you. There are no programming questions in the lounge. You should probably post this in the Quick Answers instead.
|
|
|
|
|
|
Working on a remote server for a customer - has VS 2015 installed. Microsoft has decided through it's "magic" that I don't have a license anymore. Fine, I'll update you to community edition. Nope, have to uninstall first. Okayyyy, go to the Apps and Features for VS 2015 - no uninstall option. I have to "modify" the installation. Okayyyy... it's been going for 4 hours now.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Wouldn't it be the customer who needs the license, since it's installed on their machine?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
technically maybe? I'm a small company so on occasion I will install CE to complete some debug work. Then I remove it. Today's phrase is "if I Can remove it."
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
The risk here is that you end up partially removing the older version, and failing to install the new one. Then you have two problems on your hands - getting the original reinstalled, and solving its license problem.
|
|
|
|
|
Hey! No spoilers in the lounge!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|